• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

How to migrate your local database to Amazon RDS

kryz0

Chevereto Member
For those that want to horizontally scale their website and share the same database across multiple servers, or save compute resources by moving the database off your server, here's how you do it.

This assumes a few things:
  • You are migrating to Amazon RDS and you already know how to create an RDS instance (but should work for any database host).
  • You are familiar with command line.
  • You are using a VPS or Ubuntu server.
  • You have a default chevereto installation.

Step 1:
First, lets change users so we have proper permissions:
Code:
sudo su

Step 2:
Change directories:
Code:
cd /var/www/html

Step 3:
Create a backup of the local mysql database:
Code:
mysqldump -u chevereto -p chevereto > database_backup.sql

Step 4:
Connect to your RDS database. This can be done via command line like we're about to do, or via a GUI like Navicat or whatever you prefer.
Code:
mysql -h [endpoint.for.rds.instance] -P 3306 -u [rds_username] -p
(Enter your password you set during RDS setup)
create database [rds_database];

You can name the database anything you want, same with username. Remember to replace [rds_username] with your RDS username and remove the brackets. Same for [rds_database] and [endpoint.for.rds.instance].

Step 5:
Migrate the backup to RDS. Again, replace the stuff in brackets and make sure the database_backup.sql is the same as the one you made in step 3.
Code:
mysql -h [endpoint.for.rds.instance] -u [rds_username] -p  [rds_database] < database_backup.sql

Step 6:
Change your env to your new database.
Code:
nano app/env.php

Replace the values with your RDS information. It's a good idea to save the default info somewhere just in case you need it. You can leave the encryption key, port, and table prefix as-is. Just change the host, name, pass, and user.

Ctrl + X to exit.
Press Y to save modified buffer.
File name to write, just press Enter.

Step 7:
Restart Apache
Code:
sudo systemctl restart apache2

Step 8:
Lets load the website and see if it's working. Upload a file to test.

Step 9:
Delete the database backup.
Code:
sudo rm -rf database_backup.sql

That's it! We're done.
If you have issues, drop a comment. Or check your RDS security groups and make sure your VPS instance can access the RDS instance. This is streamlined if you use EC2.
 
Back
Top