| Home » Categories » Multiple Categories |
How To Migrate a MySQL Database Between Two Servers |
|
Article Number: 185 | Rating: Unrated | Last Updated: Tue, Sep 23, 2025 at 11:32 PM
|
| Transferring a database between virtual private servers can be
accomplished using a SCP (Secure Copy), a method of copying files
derived from the SSH Shell. Keep in mind, you will need to know the
passwords for both virtual servers. In order to migrate the database, there are two steps: Step One—Perform a MySQL DumpBefore transferring the database file to the new VPS, we first need to back it up on the original virtual server by using the mysqldump command.mysqldump -u root -p --opt [database name] > [database name].sqlAfter the dump is performed, you are ready to transfer the database. Step Two—Copy the DatabaseSCP helps you copy the database. If you used the previous command, you exported your database to your home folder.The SCP command has the following syntax: scp [database name].sql [username]@[servername]:path/to/database/A sample transfer might look like this: scp newdatabase.sql [email protected]:~/After you connect, the database will be transferred to the new virtual private server. Step Three—Import the DatabaseOnce the data has been transferred to the new server, you can import the database into MySQL:mysql -u root -p newdatabase < /path/to/newdatabase.sqlWith that, your transfer via SCP will be complete. |
Attachments
There are no attachments for this article.
|
How To Create a New User and Grant Permissions in MySQL
Viewed 3842 times since Thu, Dec 26, 2013
How To Create and Manage Databases in MySQL and MariaDB on a Cloud Server
Viewed 3435 times since Thu, Dec 26, 2013
How To Manage Packages In Ubuntu and Debian With Apt-Get & Apt-Cache
Viewed 7376 times since Fri, Dec 27, 2013
How To Protect SSH with fail2ban on Debian 7
Viewed 3294 times since Fri, Dec 27, 2013
How To Set Up Master Slave Replication in MySQL
Viewed 3966 times since Thu, Dec 26, 2013
How To Configure and Maintain Ghost from the Command Line
Viewed 7255 times since Sun, Dec 29, 2013
How To Manage Content Using the Ghost Blogging Platform
Viewed 9487 times since Sun, Dec 29, 2013
How To Install And Run A Node.js App On Centos 6.4 64bit
Viewed 11065 times since Sun, Dec 29, 2013
How To Use Yaourt to Easily Download Arch Linux Community Packages
Viewed 4809 times since Fri, Dec 27, 2013
What is FTP and How Is It Used?
Viewed 3011 times since Fri, Dec 27, 2013
|
