Migrating WordPress manually: files, database and wp-config.php
A WordPress site consists of two parts: the files (WordPress itself, your theme, plugins and uploads) and the database (your pages, posts, users and settings). The wp-config.php file connects the two. If you move your site manually, you transfer both and update wp-config.php. Here you'll find the steps for moving to a WebOké hosting package.
First: does it have to be done manually?
Doing it manually takes the most work, but you see every step, and it also works when other methods get stuck. There are easier ways:
- In the Website Manager in My WebOké, choose Import website and The website is hosted with another provider. See Can I do this in My WebOké too? The Website Manager.
- Installatron can fetch a site from another server: Importing an existing website into Installatron.
- You can also let us handle the move: Free migration service: how we move your website to WebOké.
Are you also moving your domain and your email? Then first read Moving your domain, website and email together without downtime: the step-by-step plan. That determines the order.
Step 1: the files
- At your old host, create a zip of your site's entire web folder, or download all files using SFTP or FTP. Don't forget
.htaccess: files starting with a dot are often hidden. - At WebOké, upload the zip to
domains/example.com/public_htmland extract it there. See Extracting and creating zip files. Make sure your site doesn't end up one folder too deep. - Remove WebOké's default
index.htmlpage if it's still there, and delete the zip after extracting it.
Step 2: the database
- Export the database at your old host, for example with phpMyAdmin. At WebOké, this is how it works: Exporting a database.
- In DirectAdmin, create a new, empty database with a user. Your DA username and an underscore are automatically added in front of the name. Write down the name, user and password. See What are the username, password and database name for MySQL?
- Import your export into that database. If it contains a
CREATE DATABASEorUSEline with the old name, remove it. See Importing a database, including large files.
public_html, not even briefly. Anyone who guesses the name can download it, along with all the data of your site and your customers. Use the root folder of your package and delete the file when you're done.Step 3: updating wp-config.php
Open wp-config.php in public_html with File Manager (right-click, Edit) and enter the details of the new database:
define( 'DB_NAME', 'gebruiker_wp' ); define( 'DB_USER', 'gebruiker_wp' ); define( 'DB_PASSWORD', 'het-wachtwoord-van-de-databasegebruiker' ); define( 'DB_HOST', 'localhost' );
At WebOké, the host is always localhost. Also check the $table_prefix line: it must use the same prefix as the tables in your database, for example wp_. If any of these details is wrong, you'll see "Error establishing a database connection", see Error establishing a database connection.
Step 4: new address? Search and replace
If the domain stays the same, nothing needs to change in the database. If your site moves to a different domain or from http to https, replace the address throughout the database with a tool that understands serialized data. Never use a plain SQL query for this. See Search and replace in the WordPress database.
Step 5: testing before the domain moves
If your domain still points to your old host, you can already view the site with us without changing anything in the DNS. See Viewing your website at WebOké before you move your domain name. Check your pages, logging in, forms and your shop, if you have one.
Step 6: switching over
- Do you have a webshop or do you receive comments? Then don't change anything on the old site from now on. Transfer the database one more time if anything has changed since step 2.
- Point your domain to WebOké or transfer it, following the step-by-step plan in KB 99 above.
- After the move, your site automatically gets a certificate. If that doesn't work, see Activating and renewing an SSL certificate and troubleshooting.
After the move
- If pages return a 404, save once under Settings > Permalinks. More causes are listed in My website doesn't work after uploading or moving.
- Check whether your site sends email, see Sending email from WordPress and WooCommerce reliably via SMTP.
- If you had cron jobs at your old host, set them up again. See Cron Jobs: running tasks automatically.
- Import the site into Installatron or the Website Manager, so you can update and back it up there (KB 182 above).
- Only cancel your old hosting once everything has been working well for a few days, and download one last backup there first.
Did your site also move to a different domain? Then redirect the old domain and keep it. See Moving your website to a different domain without losing search visibility.
Further reading
- Migrating WordPress on developer.wordpress.org (English)
Want to learn more? Take the free WordPress course, lesson 9.5 Moving a WordPress site.
