title | excerpt | updated |
---|---|---|
Backing up and exporting a database of your database server |
Find out how to back up and export your database |
2023-10-26 |
Your database can contain a lot of essential information for your website. It is therefore important to be able to save it, or even export it.
Find out how to back up and export your database from your database server.
- You must have a Web Cloud Databases instance{.external} (included in a Performance web hosting plan).
- access to the OVHcloud Control Panel
Please note that the Web Cloud Databases{.external} solutions do not give access to the database management system, but to the databases hosted on it.
- Please note that there is no "root" access.
- Generic SQL commands work normally, and software such as HeidiSQL, SQuirreL or Adminer is fully compatible.
Log in to your OVHcloud Control Panel and select Web Cloud
{.action} in the top navigation bar. Click Web Cloud Databases
{.action} in the services bar, then choose the SQL instance concerned. Next, go to the Databases
tab.
In the Backups column, the number corresponds to the number of backups available for your database.
[!primary]
- Backups are performed automatically once a day for all your databases.
- Automatic and manual backups are available for 30 days. After this period, they will be automatically deleted.
Click the ...
{.action} button to the right of the database, then click Back up now
{.action}.
Click the ...
{.action} button to the right of the database, then click Show backups
{.action}
The list of available backups will appear. Click on the ...
{.action} button to the right of the backup you want to create, then click Download the backup
{.action} to retrieve this backup.
In some cases, the RAM available in your database server may not be sufficient to perform the desired import. If this is the case, we recommend using the tool available in the OVHcloud Control Panel. This will enable you to use resources external to your solution.
To export your database directly from phpMyAdmin, you will need to log in to the interface first. To do this, you can refer to our guide on connecting to a database.
Once you have logged in to phpMyAdmin, click on the name of the database you want to export, then on the Export
{.action} tab at the top.
You have two possible export modes. If you do not have a specific need, we recommend using quick mode in SQL format.
mysqldump --host=server --user=username --port=port --password=password database_name > database_name.sql
1. <?php echo "Your database is being backed up.......";
2. system("mysqldump --host=server --user=username --port=port --password=password database_name > database_name.sql");
3. echo "Completed. You can retrieve the database via FTP.";
4. ?>
Warning
- To prevent someone from accessing this file containing sensitive data, you can secure access to it.
- This action is only possible on an OVHcloud Web Hosting plan.
In some cases, the RAM available in your database server may not be sufficient to perform the desired import. If this is the case, we recommend using the tool available in the OVHcloud Control Panel. This will enable you to use resources external to your solution.
pg_dump --host=server --port=port --user=usernmame --password=password database_name > database_name.sql
1. <?php echo "Your database is being backed up.......";
2. system("PGPASSWORD=password pg_dump --host=server --port=port --user=username --password=password database_name > database_name.sql");
3. echo "Completed. You can retrieve the database via FTP.";
4. ?>
Warning
- To prevent someone from accessing this file containing sensitive data, you can secure access to it.
- This action is only possible on an OVHcloud Web Hosting plan.
Restoring and importing a database to your database server
For specialised services (SEO, development, etc.), contact OVHcloud partners.
If you would like assistance using and configuring your OVHcloud solutions, please refer to our support offers.
Join our community of users.