This is the first of a two-part series covering common and best practices around launching a new WordPress site to your web host. While this first session is slightly more introductory, it still covers some of the more technical aspects of moving files and databases. Topics covered include:
• Determining what needs to be moved to your web host
• Prerequisites for migrating your site (tools, credentials)
• Differences between site files (themes, uploads) and content (database)
• Required changes if the domain name has changed
The discussion was concluded with a short demonstration.
While this is handy information for developers who build sites locally, the hope is that there is useful information for those who find themselves needing to move a site from one web host to another.
Credits for slide graphics to Wilson Joseph, Noun Project
The standard WordPress installation includes many
ﬁles which interpret browser requests and load the
Most importantly, the conﬁguration ﬁle deﬁnes the
settings WordPress should use to connect to a
MySQL database. You can also deﬁne security and
The theme directory contains the layout and styles
for displaying your site.
Each plugin adds unique behavior to your site. The
plugin ﬁles describe the behavior, and additional
customizations are typically stored as options in the
Media ﬁles (images, videos, documents), including
thumbnails, are stored here.
The contents of your posts and pages aren’t stored
in the WordPress site directory, but instead live in
the MySQL database.
• PHP 5.2.4 or greater
• MySQL 5.0 or greater
• Usually Apache HTTP Server or nginx
A FTP (File Transfer Protocol) client enables you to
move ﬁles between your computer and a remote
• Always prefer SFTP (FTP over SSH) if oﬀered
by your host, since plain FTP can be insecure
A database client allows you to browse the content
of your WordPress site. It usually provides export
and import options to move your content from one
place to another.
1. Find or create user credentials for both FTP and
database access. You may need to create a
database if one doesn’t already exist
2. Move entire site from local directory to host
• Or, download and move WordPress core,
theme, plugins, and uploads
3. Export database contents as .sql “dump” using
database client, then import to host database
Preparing your site
Content stored in the database includes references to your site’s
previous domain. If this has changed as a result of moving from a
development site, or as a result of changing your domain, you’ll need to
replace all occurrences in the database. This is also necessary for
WordPress to recognize and use the new domain.
Replace old URLs
wp search-replace 'http://example.dev' 'http://example.com'
Preparing your site
If your site is hosted on a diﬀerent server, you will need to update your
domain records to correctly point to the new server.
Update host records
• Tip: You can also modify a “hosts” ﬁle on your local computer
to test how your new server will respond to the domain before
making the real change