Backing up and Restoring a Single Database via SSH

At the moment, taking backups for a single database is not available in the Control Panel. This article will explain how you can back up and restore a single database via SSH.

Note: For security reasons, only the accounts have passed our verification will be granted permission to the Shell / SSH service. If you would like to enable it, please update your billing information. Our staff will finish verifying your information within 2 hours.

Backup

1. Locate the target deployment

Log in to the Control Panel and locate your target deployment on the Home page or the My Applications page.

2. Navigate to the Shell / SSH page

Click the "Manage" button on the Home page or the My Applications page to go to the Shell / SSH page.

3. Back up a database

Click the “Connect” icon on the Shell / SSH page to launch the command-line interface.

For security reasons, only the accounts have passed our verification will be granted permission to the Shell / SSH service. If you would like to enable it, please update your billing information. Our staff will finish verifying your information within 2 hours.

Input the command “pg_dump -U <db_user> -d <db_name> -F c -b -v -f <file_name>”, followed by pressing the “Enter” key. The system will start backing up your database.

<db_user>:the user name of the database you would like to back up

<db_name>: the database name you would like to back up

<file_name>: the name of your backup file.

Type in the command “ls”, you can see the backup file.

4. Export files

You can download the file on your local machine using FTPS. For details, please take a look at the documentation.

Restoration

1. Connect to the database

Log in to the Control Panel, and click the “Connect” icon on the Shell / SSH page to launch the command-line interface.

2. Restore a backup file

Input the command “pg_restore -U <db_user> -d <db_name> -v -c <file_name>”, followed by pressing the “enter” key. The system is restoring your backup file.

<db_user>:the user name of the database you would like to back up

<db_name>: the database name you would like to back up

<file_name>: the name of your backup file.

Copyright © 2021 Cloud Clusters Inc. all right reserved,powered by GitbookRevised on 05/10/2021

results matching ""

    No results matching ""