2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Log in to the DBSync GSuite instance - https://app03.mydbsync.com/appcenter/login
  • Enter login credentials
  • You will be redirected to the apps page.
  • Select the profile from the landing page. Current example has admin user privileges. 

  • Click the GSuite icon from the top navigation toolbar

...

  1. Make sure that you have selected the newly created project from the project selector on the top nav bar.

  2. Once selected, from the left menu, under “APIs & Services” select “Credentials”.

  3. Click “Create Credentials” from the top nav bar and select OAuth Client ID.

  4. Select a “Desktop Application” for now since we do not have this application hosted anywhere.

  5. Give an appropriate name and click “Create”.

  6. Download the client secret on your environment and name it client_credentials.json

Setting up the server/local environment

Once the GCloud project is set up, we should now set up the local environment. Following steps to do so:

  1. The code is pushed on the bitbucket repository: https://bitbucket.org/outsourced-projects/google-cloud-backup/src/master/

  2. The code is pushed on the master branch.

  3. Copy the 2 files downloaded GCloud Project (g_suite_credentials.json and client_credentials.json) and save it under src/main/resources folder.

  4. In MySQL create a new database and enter the credentials in application.properties under src/main/resources

  5. Update the following properties based on the DB Name, and your MySQL setup:

    1. spring.datasource.url

    2. spring.datasource.username

    3. Spring.datasource.password

  6. Create a folder where you want all the backup files to be stored and update the following from application.properties:

    1. EML_FILE_PATH

    2. ICS_FILE_PATH

    3. VCARD_FILE_PATH

    4. DRIVE_FILE_PATH

  7. If you want to backup all users then in application.properties set the following property to ALL:

    1. include.users.backup

  8. Else set it to comma separated emails for any specific users you want to take a backup of.

Once the above is done, you are all set to execute the project.

Building and Executing the project

Once the above is set up following process to build and execute the project:

...

Build the project using maven clean install -DskipTests

...

Once build is complete, there will be a target folder generated and inside it will be a JAR file with the name: DbSync-0.0.1-SNAPSHOT.jar

...

Use the following command to execute the project:

  1. java -jar DbSync-0.0.1-SNAPSHOT.jar

  2. Make sure you copy the jar out of the target folder to some other location and then run the app.

...

The execute the following APIs for each of the backup to execute:

...