How to archive data for a G Suite user or a Shared Drive


The cbackup archive command allows you to archive the backup data for a G Suite user or a Shared Drive to specified storage. This is especially useful when an employee has left your organization and you would like to keep an archive of his data for possible future use.

cbackup archive command

cbackup archive <domain name> <user email or shared drive id> <app> <destination path>
  • domain name: the name of your domain (e.g. mycompany.com)
  • user email/shared drive id: the user account you wish to archive (e.g. someone@mycompany.com), or a shared drive ID (e.g. AAGFI5-SlBKnUk9PV)
  • app: must be one of these values: all, gmail, drive, calendar, contacts, sites. Choose all to archive all G Suite data for a user.
  • destination path: The output directory. This can be a local directory or a location on your network.

TIP: If you want to compress the archive data to a ZIP file, you can also specify the name of the ZIP file as the destination path. For example:

cbackup archive mycompany.com  someone@mycompany.com all  /var/archive/cube.zip

will archive all data of user someone@mycompany.com into the cube.zip file instead of exporting all files into a directory.

NOTE: This command requires special privilege.
On Windows, it must be run by an Administrator account.
On Linux, it must be run by the cbuser account.

Detailed instructions on cbackup archive command can be found at here.

Archive data for a G Suite user

Suppose you want to archive all G Suite data for user abc@companydomain.com to a directory named archive_data. (The directory can be located on a local disk or on your network.)

For Windows Users

  1. Login to the backup server.
  2. Open a Windows Powershell or Windows Command Prompt using an Administrator account.
  3. In the <cubebackup installation folder>/bin directory, run the command:

    cbackup archive companydomain.com  abc@companydomain.com all f:\archive_data
    

For Linux Users

  1. SSH into the backup server.
  2. Make sure cbuser has write permission to the target directory. One way to do this is to change the owner of the target directory to cbuser.

    sudo chown cbuser:cbuser  /mnt/archive_data
    
  3. In a bash shell, run the command:

    sudo -u cbuser cbackup archive companydomain.com  abc@companydomain.com all  /mnt/archive_data
    

Archive data for a Shared Drive

Suppose you want to archive all data for shared drive “Dev TD” to a directory named archive_data. (The directory can be located on a local disk or on your network.)

For Windows Users

  1. Login to the CubeBackup console.
  2. Find out the ID for the shared drive. You can find the ID for a shared drive in the URL of this shared drive’s Restore page. shared-drive-id
  3. Login to the backup server.
  4. Open a Windows Powershell or Windows Command Prompt using an Administrator account.
  5. In the <cubebackup installation folder>/bin directory, run the command:

    cbackup archive companydomain.com  0AAfuul0eM6ZFUk9PVA drive f:\archive_data
    

For Linux Users

  1. Login to the CubeBackup console.
  2. Find out the ID for the shared drive. You can find the ID for a shared drive in the URL of this shared drive’s Restore page. shared-drive-id
  3. SSH into the backup server.
  4. Make sure cbuser has write permission to the target directory. One way to do this is to change the owner of the target directory to cbuser.

    sudo chown cbuser:cbuser  /mnt/archive_data
    
  5. In a bash shell, run the command:

    sudo -u cbuser cbackup archive companydomain.com  0AAfuul0eM6ZFUk9PVA drive  /mnt/archive_data