The biggest source of anger I’ve witnessed from WordPress users is when they wish to transfer their WordPress website. That is, they want to share the entire site from one hosting provider to a different hosting provider. In this article, I’ll explain four simple steps for moving an existing WordPress site to another hosting.
This article assumes it is possible to access both the previous server as well as that of the brand-new server. You can access both servers through FTP as well as SSH.
Step 1) Back Up the Database
WordPress keeps information in the MySQL database. You’ll have to move this database to relocate the website, and this is the most difficult component. It is necessary to backup your database from the old site before you do this.
Method 1) Use a Plugin
There is a method for backing up your database with an application plugin. Make sure that you’re dealing with a huge database (say over 50 MB); you should consider employing the second method.
WordPress has a number of plugins that back up your database. My favorite is the plugin, the wp-db-backup. After the plugin has been installed and activated, go to Options > Backup in the administrator.
The plugin will search for tables that are not in that same database. These tables that aren’t “core” WordPress tables may be derived from other plugins that you’ve installed, which store information within these tables.
Choose if you want the backup file to be sent to you via email or downloaded straight from the internet, and then click on the “Back Up Now!” button.
Method 2) Use the Command Line
We’ll be closer to the real thing by using SSH. SSH (Secure Shell) is a protocol for networks that allows you to access your server through an encrypted connection securely.
In the beginning, you’ll need for you to be able to access the server. It is necessary to know your server’s IP along with your username, password, and username. Additionally, you’ll require a command-line client such as Terminal to Mac as well as Putty for Windows.
$ ssh username@[server IP[server-ip
If this is the first time you’ve established a connection, you will be presented with an alert. Are you certain that you’re ready to connect? Type yes and then press return. After that, you’ll be required to use the SSH account password. Once you’ve entered your password, you’ll be connected to the server using SSH.
You can now export your database using the command below.
$ mysqldump -u [username] -p [database_name] > [name_your_backup_file].sql
You’ll need to change the options listed in brackets with your personal information. The username you enter isn’t the same in this instance as it is your SSH password; rather, it’s actually your MySQL login username. The name of your database can be found in the `wp_config. phpfile, if you’ve lost your. The system will also ask to enter a password following this action, which is the password to your database that you can obtain from the `wp-config.php file.
This will create a new file (which you name at the end of the command) that is an entire copy of the database. It is possible to point yourself to a suitable directory to run the order so that it can create the file there. You can also include the path to the file inside the base.
You’ll need an offline copy of the database.sql backup files. One method to get it is to upload it via FTP onto the server, then navigate to where it was discarded and transfer it to the location you dumped it. If you’re already at the command prompt anyway, shut down your SSH connection and then use your scp function to download it. It could be something like:
$ scp [username]@[server-ip]:[backup_file].sql .
Step 2) Backup Files
Now is the time to back up your real data from the server that was previously used. These include your themes or plugins, the uploads, etc… Everything. You even have your WordPress base files, but this is a good moment as any to download a new version of them for the new server.
In order to download your entire file from your old host, make use of an FTP client such as Filezilla in order to connect to your server, download Everything from the web root, or download only the wp folder if you’re looking to create a new version of WordPress on your brand new host first.
It could take some time! There are likely to be a lot of photos and files.
Step 3) Move the Files to the New Server
You can now log in to your new server, as well as through FTP, to transfer your files into the web root directory that you downloaded from the previous server. It could take a bit of time (uploading is typically slightly longer as compared to downloading).
Step 4) Import the Database to the New Server
In this stage, you’ll connect the database to the server. The process also comes with two ways to do it: through PHP myAdmin or SSH.
Method 1) via Control Panel
Most web hosts will offer some control panel that allows access to databases, for instance. It could be cPanel. It could be Plesk. It could be a special item.
You will likely make use of this control panel to build the database you’ll be using on the new server. The control panel probably grants you access to a program called phpMyAdmin, which is an application specifically designed to manage MySQL online.
Access the database that is new for the new website.
Now for the time to be honest: import from the backup `.sqlfiles from the old website!
Click on the import tab at the top of the navigation.
Then, you can choose the `.sqlThe file is on your computer local to you and open this file (press the Go button).
Method 2) via SSH
In the event that your database is big, as with exporting, you could SSH into the server and perform the import there. The first step is to upload the export of your database to the new server and then connect via SSH to the server (instructions on this are in the earlier section). Then, run this command in order to start the import:
$ mysql. -p -u [username][database_name] [database_name].sql
Here, the username refers to the MySQL user and not the SSH user.
It is also possible to alter some of your choices.
If you’re altering the address of your site while moving servers, you may require some more MySQL work. For instance, if moving between domain-one.com to domain-two.com, You’ll need to modify the URL of your site as well as the home options on the table called wp_options.
It won’t affect references that are hard-coded to domain-one.com in the content of posts, however (e.g., image sources). If you’re looking to alter this too, there’s an SQL you can refer to in the article on changing WordPress into HTTPS that might be beneficial.
Leave a Reply