In the world of Odoo, efficient database management is crucial for smooth business operations. The process of uploading and importing backups in Odoo SH is a pivotal aspect of database management for users looking to seamlessly transition between versions or safeguard their data. By navigating through well-defined steps, starting from accessing the backups tab and making choices based on the dump size, users can efficiently handle the import process.
This blog provides a comprehensive guide on how to import databases in Odoo SH. This comprehensive guide not only demystifies the complexities of backup uploading and database importing but also underscores the importance of a systematic and secure approach. By following these steps, Odoo SH users can confidently manage their application data, fostering a resilient and well-maintained environment.
Upload the backup
By clicking the backups tab of your production branch, you can import the backup you just downloaded.
After clicking the "Import Database" button, a popup with two options will appear.
1. Through your browser(Easier for dumps smaller than 2GB).
2. Through SSH(for dumps over 2GB).
Through your Browser
After selecting the first option, ensure you're on a stable internet connection. Then, you will find a browse button; select the file and click on the import button located at the bottom.
Through SSH
If the dumps are more than 2GB, we can choose the second option to import.
Adding Access Key to Your Profile
Generate a new SSH key on your local machine. Once generated, add the public key to your profile. Open the terminal, paste the text below, and replace the example email with your GitHub email address.
ssh-keygen -t ed25519 -C "your_email@example.com"
When prompted to "Enter a file in which to save the key," simply press Enter to accept the default file location.
After saving the public key, navigate to the specified location, copy the key, and then paste the SSH key under your profile.
After adding the public key to your profile. To import the database through SSH, you can use the following command:
rsync -P --inplace <zip_dump_file>
<build_id>@<domain>:/home/odoo/odoosh_import_dump.zip
Upon completion of the rsync upload, initiate the process by clicking the Import button.
After importing the backup, database access can be obtained by clicking the Connect button within the branch history.
For smaller dumps, the browser option offers simplicity, while larger dumps exceeding 2GB necessitate the secure and efficient SSH route. The addition of an access key to the user's profile enhances security during the import process. The step-by-step guide for generating, saving, and adding the SSH key ensures a smooth and secure pathway.
Whether through the browser or SSH, the process culminates with the click of the Import button, initiating the transfer of data. Once the rsync upload is completed, users gain access to their imported database by utilizing the Connect button within the branch history.