Move WordPress — The complete guide for 2022

Marc Wag­ner

Octo­ber 26, 2022

6 min read|

The Word­Press move also works wit­hout a plug­in. Usual­ly even smoot­her and fas­ter. For a beg­in­ner, the move may seem like a mam­mo­th task at first glan­ce, but it’s not at all.

Of cour­se, depen­ding on the size of the site, it may take more or less time, but the steps are always the same in 99% of cases.

  1. Down­load the files from the cur­rent ser­ver using an FTP pro­gram of your choice (e.g. File­Zil­la).
  2. Export your data­ba­se (e.g. PhpMy­Ad­min, Hei­di SQL, Data Grip).
  3. Import your data­ba­se.
  4. Cus­to­mi­ze data­ba­se.
  5. Adjust the local data.
  6. Upload the local files.
  7. Fina­li­ze move.

Too com­pli­ca­ted? No pro­blem, just use a plug­in: Move Word­Press with Dupli­ca­tor.

Copy files with FTP/SFTP #

The first thing you need to do is down­load your data. You can do this com­for­ta­b­ly with a FTP cli­ent (e.g. File­Zil­la). After­wards all files are available local­ly.

To do this, sim­ply sel­ect the files from Word­Press via your FTP pro­gram. You can see which ones in the fol­lo­wing figu­re (bot­tom right).

image 35
With a FTP cli­ent like File­Zil­la you can upload all Word­Press files on your hard disk.
Save.

Down­loa­ding the files may take some time. To save time, howe­ver, we can con­ti­nue with the data­ba­se in the mean­ti­me.

Export WordPress database with PhpMyAdmin #

All the con­tents of your web­site are stored in the data­ba­se. The­r­e­fo­re, we need to export them first. Most web hosts pro­vi­de PhpMy­Ad­min for this pur­po­se. PhpMy­Ad­min is a web appli­ca­ti­on with a UI for data­ba­se manage­ment.

Once you have log­ged in to your data­ba­se, go to the Export tab.

Export PhpMyAdmin
PhpMy­Ad­min — Export your Word­Press data­ba­se.

On the fol­lo­wing page you just have to con­firm by cli­cking Ok to start down­loa­ding your data­ba­se.

PhpMyAdmin Export Seite
Export­ing the data­ba­se with PhpMy­Ad­min

Import WordPress database with PhpMyAdmin #

Now switch to your new ser­ver and crea­te a new data­ba­se the­re. Make a note of the user­na­me and pass­word for later. We need it for the wp-con­­fig.

To import the data­ba­se, switch to the Import tab.

PhpMyAdmin Import
PhpMy­Ad­min — Import Word­Press data­ba­se

Customize MySQL database for WordPress #

If you are moving the domain as well, you can skip this step. Other­wi­se, we still need to adjust the data­ba­se so that Word­Press also knows the new domain.

Customize wp_options table

In the wp_options table, we first need to adjust two ent­ries. The­se are the siteurl and home.

PhpMyAdmin wp options
Word­Press move — cus­to­mi­ze wp_options table.

Replace it with your new domain. Make sure you spe­ci­fy the pro­to­col (https) as well.

Of cour­se, the who­le thing is fas­ter with SQL, for this you chan­ge to the SQL tab and enter the fol­lo­wing query the­re:

UPDATE wp_options SET option_value = replace(option_value, 'https://www.meine-alte-domain.com', 'https://nwww.meine-neue-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

Customize WP-Config #

Next, we need to adjust the data­ba­se data in your site’s wp-config.php. To do this, chan­ge to the fol­der whe­re you have stored your Word­Press data local­ly.

In the main direc­to­ry you will find the file wp-config.php. The best way to open them is with Note­Pad++.

The­re you will find the fol­lo­wing ent­ries:

/**
 Ersetze datenbankname_hier_einfuegen
 mit dem Namen der Datenbank, die du verwenden möchtest.
 */
 define( 'DB_NAME', 'www.forge12.com' ); 
 /**
 Ersetze benutzername_hier_einfuegen
 mit deinem MySQL-Datenbank-Benutzernamen.
 */
 define( 'DB_USER', 'root' ); 
 /**
 Ersetze passwort_hier_einfuegen mit deinem MySQL-Passwort.
 */
 define( 'DB_PASSWORD', '' ); 
 /**
 Ersetze localhost mit der MySQL-Serveradresse.
 */
 define( 'DB_HOST', '127.0.0.1' ); 

Now enter the new access data to your data­ba­se here.

DB_NAMEHere you enter the name of the data­ba­se
DB_USERThe user with which you log in to your data­ba­se
DB_PASSWORDThe pass­word you spe­ci­fied for the data­ba­se.
DB_HOSTThe path to the data­ba­se. Most­ly this is “local­host” or “127.0.0.1”. Some pro­vi­ders (e.g. IONOS) use an alter­na­ti­ve address.
Word­Press Con­fig Para­me­ters and Their Mea­ning

Upload files to the new server #

Now you can start uploa­ding your files to your new ser­ver using your FTP cli­ent (e.g. File­Zil­la). Enter the FTP data for your new web host. Then chan­ge to the main direc­to­ry of your hos­ting and upload the files.

image 35
Upload Word­Press files

Once you’­re done, the struc­tu­re should be the same as your old web­site.

Complete move #

The basic set­tings have been made — but your page will pro­ba­b­ly not yet be dis­play­ed as you hope. This is becau­se we still have to make a few final adjus­t­ments.

To do this, go to the Word­Press admin panel of your new site. (https://deineneuedomainXYZ.de/wp-login.php)

First, go to Set­tings, Per­ma­links and con­firm the Save Chan­ges but­ton once. This will update the per­ma­links and rege­ne­ra­te the .htac­cess file of your web­site.

WordPress Permalinks Erneuern
Renew Word­Press per­ma­links

Next, we install the Bet­ter Search Replace plug­in. This allows to search the data­ba­se for links and replace them.

Wait, you say, why do I need a plug­in? This can also be done with SQL. Par­ti­al­ly Cor­rect! But the­re are actual­ly plug­ins and the­mes that seria­li­ze your data.

Then the who­le thing looks some­thing like this in the data­ba­se:

a:5:{i:0;i:10;i:1;s:19:"www.meine-domain.de";s:16:"Ich bin ein Text";}

What is inte­res­t­ing here is this part:

s:19:"www.meine-domain.de";

This spe­ci­fies how long the string behind it is — in our exam­p­le: 19 cha­rac­ters. But if you chan­ge the domain and it is not exact­ly 19 cha­rac­ters long again, you will get an error when exe­cu­ting it.

Howe­ver, the Bet­ter Search Replace plug­in can be used to work around the pro­blem. The­re, the data is first read from the data­ba­se, dese­ria­li­zed and then stored again in seria­li­zed form.

You see, we have alre­a­dy eli­mi­na­ted ano­ther poten­ti­al source of error. Now install the plug­in, you will find it under Tools — Bet­ter Search Replace.

image 36
Bet­ter Search Replace Dash­board

After instal­ling and acti­vat­ing the plug­in, you just fill in the fields. Pay atten­ti­on to the spel­ling.

By pres­sing CTRL+A you can sel­ect all tables in which you want to search for the occur­rence. We want to replace all domains, so we sel­ect all tables for this.

If you are unsu­re, you can still acti­va­te the test run at the end. Only a search is per­for­med — no data is chan­ged.

Once you are sure that ever­y­thing fits, uncheck the Test Run box and click the Start Search/Replace but­ton. After that, the move is com­ple­te.

Conclusion #

Con­gra­tu­la­ti­ons — you have suc­cessful­ly com­ple­ted the move of your Word­Press web­site. As you can see, it’s not rocket sci­ence with stan­dard pages. Woo­Com­mer­ce stores can also be moved easi­ly in this way.

Of cour­se, the­re are always excep­ti­ons. Not every web­site is the same and depen­ding on plug­ins, exten­si­ons and cus­to­miza­ti­ons it can hap­pen that you have to cus­to­mi­ze some­thing else as well.

That’s what we’­re here for. We per­form Word­Press moves for busi­nesses quick­ly and easi­ly.

If you need help, you can eit­her book our Word­Press rem­oval ser­vice, or book an appoint­ment with one of our deve­lo­pers for pro­blem sol­ving.

88e86fcb816eff22bc917094df2862d8dd5c0e978b333e6dd5f36f808990c261 96

Arti­kel von:

Marc Wag­ner

Hi Marc here. I’m the foun­der of Forge12 Inter­ac­ti­ve and have been pas­sio­na­te about buil­ding web­sites, online stores, appli­ca­ti­ons and SaaS solu­ti­ons for busi­nesses for over 20 years. Befo­re foun­ding the com­pa­ny, I alre­a­dy work­ed in publicly lis­ted com­pa­nies and acqui­red all kinds of know­ledge. Now I want to pass this know­ledge on to my cus­to­mers.

Hast du eine Fra­ge? Hin­ter­lass bit­te einen Kom­men­tar