Guides and tutorials

Hundreds of tutorials and step by step guides carefully written by our support team.

How to migrate my Wordpress to SW Hosting

First, we need to get the information from the origin server, specifically the credentials of the FTP user and the database user, as well as the name of the database.

Once the data is obtained, you must access the service of your SW Panel to create the users and the database.

Access the hosting service in SW Panel

First, go to your SW Panel and, in the search window at the top, you must indicate the name of the hosting service you want to configure. Once the service is found, you can click on its name to access its Dashboard. enter image description here

Create an FTP user in the SW Panel

To create the FTP account, you must go to FTP Management, located in the menu on the left side in blue. Once in FTP Management of your service, you must go to Create account or Create your first FTP account

enter image description here

In the section to create a new FTP account, you must enter the username and password, define the write permissions and select the web directory. To finish, click Create account.

enter image description here

Important: We recommend generating a new random password.

Create a database with your user in Panel SW

To create the database, go to Database Management, located on the left side blue menu. Once in "Database Management" of your service, if you have not yet created any user or database, you must go to Create your first MariaDB database. Otherwise, you will have to access the tabs to create the user and the database separately.

enter image description here

Once in the Create a new MariaDB database section, you must define the name of the database and select the server where you want to create it. In the last section, define the name of the user who accesses the database, her password and the permissions she will have in it, in this case the user must have full control. To finish you must click on Create MariaDB.

enter image description here

Important: We recommend generating a new random password.

Migrating files between servers using the FTP protocol

In this section, we are going to download all the web content from the previous server (source), and we are going to save it locally (on your computer). Once downloaded, we will upload all the files to the new server (destination).

Install and configure the FTP client

Before starting, to download all the files from the source server, we need an FTP client, there are different applications such as FileZilla, WinSCP, SmartFTP, Cyberduck ... We recommend using FileZilla. In the manual, we are going to use this application.

You can download FileZilla for free by clicking on the following link:

https://filezilla-project.org/download.php?type=client

At the end of the installation, we will run the application to configure the **source * and destination site. To do this you must go to the Site Administrator, located in the first icon in the upper left corner.

enter image description here

Once in the Site Manager, you must create two new sites, the Source Server and the Destination Server. Both of you must configure your ip, port, username and password.

enter image description here

Download files by FTP

Once the sites setup is complete, you must connect to the origin server to download the data locally.

enter image description here

Upload files via FTP

Once all the data has been downloaded, you must access the destination server to upload all the files previously downloaded.

enter image description here

Migrate the database between servers using phpMyAdmin

In this section, we are going to export the database from the previous server (source) and we are going to save it locally (on your computer). Once downloaded, we will import the database to the new server (destination).

Database export

To get started, let's log into phpMyAdmin on the origin server.

Once inside, we are going to select the database and then click on the Export tab. When accessing the export section, we will select the quick method of export and in SQL format. To finish, click continue to download the SQL file locally (your computer).

enter image description here

Import from database

To get started, we are going to login to phpMyAdmin of the destination server, we will select the database and then click on the Import tab.

Once inside, we will select the local file previously downloaded. You must define the character set of the file in utf-8, the format in SQL and Compatibility "none". ou should also check the checkboxes to allow import interrupt on error, enable foreign key verification, and not use AUTO_INCREMENT with the value 0. To finish, you must click Continue.

enter image description here

If the import was successful, the following notification will appear:

enter image description here

If not, you should check the errors in the database to mitigate them.

Check the WordPress configuration for the new server

By changing servers, you can affect the connection strings of the database, FTP access, permissions and absolute paths.

For this we are going to verify the definition of each of these.

In the files previously downloaded locally, you must locate the file wp-config.php.

enter image description here

Once located, to modify it, you must open it with a note editor type "Windows Notepad".

In the file, you must modify the access data to the database and FTP that were previously defined in the SW Panel.

Database:

  • Modify the name of the database: define( 'DB_NAME', 'Nombre_BaseDeDatos');

  • Modify the user to access the database: define( 'DB_USER', 'Usuario_BaseDeDatos');

  • Modify the password to access the database: define( 'DB_PASSWORD', 'Contraseña_BaseDeDatos');

  • Modify the name of the database server: define( 'DB_HOST', 'localhost');

  • Modify the coding of the database: define( 'DB_CHARSET', 'utf8');

FTP:

  • Modify the name of the FTP server: define( 'FTP_HOST', 'localhost');

  • Modify the FTP access user: define( 'FTP_USER', 'Usuario_FTP');

  • Modify the FTP access password: *define( 'FTP_PASS', 'Contraseña_FTP');

  • Modify the FTP connection method: define( 'FS_METHOD', 'direct');

Check directory paths

If at this point you have problems with permissions or parts of WordPress are not loading correctly, you should check, add or modify the following definitions in wp-config.php.

Define the wp-content directory: define( 'WP_CONTENT_DIR', dirname(FILE) . '/var/www/NombreDelDominio/datos/wb/wp-content' );

In the case of using HTTPS, you must define the following parameter: define( 'WP_CONTENT_URL', 'https://NombreDelDominio/directory/wp-content' );

In the case of using HTTP, you must define the following parameter: define( 'WP_CONTENT_URL', 'https://NombreDelDominio/directory/wp-content' );

Define the Uploads directory: define( 'UPLOADS', 'wp-content/media' );

If you still do not have access to WordPress or you do not have permissions, you should review the absolute paths that are defined in the database and, if they are wrong, modify them.

Important: when you have problems, we recommend that you activate the debugging mode in your WordPress to see the errors.

Activate debugging mode

The ** debugging mode ** is a great tool to escalate the problem and is a great help to ** find possible errors ** in your WordPress.

To do this, we must configure the wp-config.php according to your needs:

Activate debug mode: define('WP_DEBUG', true);

Disable debug mode: define('WP_DEBUG', false);

Activate on-screen error message: define('WP_DEBUG_DISPLAY', true);

Disable on-screen error message: define('WP_DEBUG_DISPLAY', false);

Activate the log file: define('WP_DEBUG_LOG', true);

Disable log file: define('WP_DEBUG_LOG', false);

The log files can be found in /wp-content/debug.log

If you are in the logs and the problem comes from a plugin or style template, you can disable it by renaming its folder with the FTP protocol. Plugins are at /wp-content/plugins/* and customization templates are at /wp-content/themes /*.

Important: once the problem is resolved, we recommend disabling all debug mode options.

Modify the domain defined in Wordpress

The last step you need to do is update the URLs, in case the website has a new domain.

Without exiting PhpMyAdmin, go to the top menu and press the SQL button. This will open an insert field of SQL code in which we are going to insert, one by one and separately, four SQL statements that will serve to update the web URL paths in case, in addition to performing the migration, you have chosen to use a new domain name different from the one you had the web in the previous hosting.

If instead you have migrated the web with the domain included, this last step is not necessary.

These are the four SQL statements that you must insert independently. Insert one, edit the 'olddomain.com' and 'newdomain.com' fields and click continue. Note: where it says olddomain.com write the old domain of the web you are migrating, and in newdomain.com put the new domain where you are migrating the web.

If everything went well, the success message will appear in green. Go back to SQL and place the second SQL statement, edit and press continue. So until all four are complete.

These are the SQL statements that you must execute:

UPDATE wp_options SET option_value = REPLACE ( option_value, ‘dominioantiguo.com’, ‘dominionuevo.com’ );

UPDATE wp_posts SET guid = REPLACE ( guid, ‘dominioantiguo.com’, ‘dominionuevo.com’ );

UPDATE wp_posts SET post_content = REPLACE ( post_content, ‘dominioantiguo.com’, ‘dominionuevo.com’ );

UPDATE wp_postmeta SET meta_value = REPLACE ( meta_value, ‘dominioantiguo.com’, ‘dominionuevo.com’ );

Very important: When you copy and paste the quotes, they may not be displayed in the correct format. Make sure to put the quotes in simple vertical format (the apostrophe right next to the question mark, at the top right of your keyboard).

If you have done everything correctly, congratulations, you have completed the entire migration process and you already have your Wordpress at SW Hosting.

More than 2000 m² of own facilities and Data Centers in Spain
Your privacy is important for us
We use our own cookies for the proper functioning of the site. In addition, third-party cookies are used for analytical purposes only. This information is not associated with any person so that personal identifying data is not stored, but is only information that is collected to identify the session, with the aim of facilitating the analysis of the website. You can change your preferences at any time by entering this website again. For more information about our cookie policy you can visit our Cookies. You can press the "Accept and close" button to give us your consent or you can access more detailed information and manage cookies.
More than 2000 m² of own facilities and Data Centers in Spain
Your privacy is important for us
We use our own cookies for the proper functioning of the site. In addition, third-party cookies are used for analytical purposes only. This information is not associated with any person so that personal identifying data is not stored, but is only information that is collected to identify the session, with the aim of facilitating the analysis of the website. You can change your preferences at any time by entering this website again. For more information about our cookie policy you can visit our Cookies. You can press the "Accept and close" button to give us your consent or you can access more detailed information and manage cookies.