Server migration
This will describe the process of migrating the site 'online store' to another server with all accumulated data.
Step 1 — Copying the database from the old server
You need to install the pgAdmin program on your computer. pgAdmin is a graphical interface for managing PostgreSQL databases.
Using pgAdmin, you need to connect to your server at the IP address on port 5432, with the password you specified when creating the docker-compose.yml file.
After you have connected to your database through pgAdmin, you need to find the database aishop, right-click on it, and select the "Backup" option from the dropdown menu. You need to specify the path where you will save the backup and give this backup a name.
After making a backup of your database (backups should be made systematically, as the server may fail, in order to avoid losing your data), you need to configure the new server according to:
1. Preparation for installation
2. Application deployment
After completing the first two steps, regarding server configuration and application installation, once you have successfully pushed the docker-compose.yml file for execution, you need to connect to the new database on the new server using pgAdmin. After connecting to the new database, you need to find the database aishop, rename it to aishop_old, and then create a new database named aishop. After creating the new database aishop, you need to right-click on it and select "Restore" from the dropdown menu. To restore, you need to specify the previously created and saved backup file of the database from the old server.
After restoring the database, you need to restart the application; for this, run the docker compose with the following command:
sudo docker compose stop
Then, run the docker compose with the following command:
sudo docker compose up -d
Thus, you have transferred the data to the new server; you will need to complete the configuration:
3. Nginx
4. Let's Encrypt
You can transfer the data at the very end, after fully configuring the new server!