Migrating from WP Engine
WPE (Wordpress engine) is a managed hosting provider for Wordpress site, charging US$ 200 per site per year.
Table of contents
- Introduction
- Preserve key data
- Migrations tasks
- Miscellaneous tasks
- Themes used by Karde
- Troubleshooting
- Final word
Introduction
Karde AS has traditionally outsourced hosting of all its Wordpress websites to WP Engine. This is a company provides premium managed hosting. Hosting a small site there costs $US 200 per year.
Basically, they provide:
- Managed security. Automatic updates of the WordPress core.
- Custom management platform that's easy to manage sites with.
- An easy to manage staging environment so you can test updates in staging and then with one click transfer staging to the live site.
- All the speed enhancements are built in so you don't have to worry about caching, etc. They provide plugins and WordPress improvements to make sure your website is as fast as possible.
- Load balancing. This means the website always has the resources it needs no matter how hard it gets hit with a spike in traffic.
Start out by reading:
WPEngine.com: Migrate a WP Engine Site to Another Host;
InMotionHosting.com: How to Migrate a WordPress site from WP Engine.
In brief
Because of Wordpress' hardwired internal URLs, migrating directly to a production websites is simplest, provided there is access to the DNS dashboard at the registrar.
- Configure Apache2 for the site.
- Set up a database for the site.
- Unpack the tarball. The siteroot goes in
/var/www/example.com/web/
. - Check that it is there.
- Set up TLS.
- Make sure you can login as admin. Often simplest to edit the
{users}
table.
If there is no login page, look at Wordpress administration.
Outdated plugins may cause PHP and other errors. Consult with client what to do with these.
Preserve key data
You may want to take a screen shot of the legacy website, to have a record of what its should look like.

Make sure you record key data about the site:
Original URL: semicolon.no.
Original IP: 35.189.107.25
.
Staging URL: semicolon.roztr.org.
Original DNS:
Host RRType Data semicolon.no ANAME semicolon.wpengine.com www.semicolon.no CNAME semicolon.wpengine.com
Test URLs:
- http://semicolon.roztr.org
- http://semicolon.roztr.org/wp-login.php
- http://semicolon.roztr.org/wp-admin
- http://semicolon.roztr.org/ws-prod/
- http://semicolon.roztr.org/ws-stage/
Migrations tasks
There are three challenges that must be faced when migrating a Wordpress site to a new Url:
- The site URL is hardwired in the configiration file and in the database, and redirections to the the old URL will stop you from logging in and access the admin dashboard.
- If the staging site is not seet up to use TLS, there may be settings in the configuration file to force TLS (SSL).
- All internal links have absolute URLs pointing to the old location.
Set up DNS
Permform the following steps to set up a parked version of the domain:
- Visit domeneshop to set up DNS-pointer for semicolon.roztr.org.
- Copy
0_parked/
into/var/www/semicolon.roztr.org
. - Edit
semicolon.roztr.org.conf
. sudo a2ensite semicolon.roztr.org.conf
apache2ctl configtest
sudo systemctl reload apache2
Install codebase and database
# Database Configuration define( 'DB_NAME', 'wp_semicolon' ); define( 'DB_USER', 'semicolon' ); define( 'DB_PASSWORD', 'xfHE0WqF3agAWrtSgvXB' ); define( 'DB_HOST', '127.0.0.1' ); define( 'DB_HOST_SLAVE', '127.0.0.1' ); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', 'utf8_unicode_ci'); $table_prefix = 'wp_';
- Unpack the tarball in
~/karde/
. - Set up
/var/private/semicolon
for database backup. - Move the
.sql
-dump into the backup directory. - Move the codebase root directory into the site root and name it web.
- Set up a database for WordPress by editing "mysql_createdb.sh". Keep
DB_NAME
, DB-user "gisle" with my own stanadrd credentials. - Edit
wp-config.php
to change credentials.
Use this command to roll back the database:
$ wp db import /var/private/semicolon/wp_semicolon.sql Success: Imported from '/var/private/semicolon/wp_semicolon.sql'.
If this fails, use this instead:
$ sudo mysql wp_semicolon < /var/private/semicolon/wp_semicolon.sql
Clean out wp-config.php
There are stuff in wp-config.php
that doesn't do
anything when no longer hosted on WPE, or do the wrong thing.
Remove all variables in in wp-config.php
starting with $wpe_
.
Remove all definitions in in wp-config.php
starting with WPE_
.
Change this setting to "true":
define( 'WP_AUTO_UPDATE_CORE', true );Remove these:
define( 'PWP_ROOT_DIR', '/nas/wp' ); define( 'PWP_NAME', 'domain-name' );
This one may not contain accurate information:
BlueTide.ca: Code to Remove from wp-config after moving from WPEngine
about what to remove. Investigate further.
Fix permissions
There is now a script to do this:
$ fixpermswp.sh Password:
Change site URL
When migrating a Wordpress site to a new URL, there are hardwired settings may result in redirections to the the old URL. This will stop you from logging in and access the admin dashboard of the relocated site.
To fix this. edit the file wp-config.php
. After the
"define" statements (just before the comment line that says "That's
It. Pecils down"), insert the following line:
define( 'RELOCATE',true );
Before testing, clear cached content in the browser.
In addition, you may need to use phpMyAdmin to change two keys in the {wp_options}
table to point to the new domain::
siteurl
home
You may also do this by means of query:
UPDATE wp_options SET option_value = 'http://semicolon.roztr.org' WHERE option_name = 'siteurl'; UPDATE wp_options SET option_value = 'http://semicolon.roztr.org' WHERE option_name = 'home';
To be able to log in, get the login name of user #1 and change the password:
$ wp user list … $ wp user update 1 --user_pass=cleartext
Open a web browser and visit /wp-login.php
on the new
server. Navigate to ( ) and
verify that both the address settings (WordPress-adresse (URL) Nettstedsadresse (URL)) are correct. Remember to Save
Changes.
Once this has been fixed, edit wp-config.php
and
remove the line.
If it still redirects to the old URL, you may try to put these
definitions (in wp-config.php
)points to the correct URL
for the migrated site (if they exist):
define( 'WP_SITEURL', 'http://semicolon.roztr.org' ); define( 'WP_HOME', 'http://semicolon.roztr.org' ); define( 'DOMAIN_CURRENT_SITE', 'semiolon.roztr.org' );
Note: Putting these wp-config.php
will stop them from displaying in the General settings in the dashboard.
Source WordPress.org: Changing The Site URL.
Fix absolute internal links
To solve the remaining problem: Absolute internal links. Use the Search & Replace plugin. [Try: Better Search Replace.]
Install the latest version from of Better SearchReplace from wordpress.org and activate:
$ wp plugin install search-and-replace --activate $ wp plugin install better-search-replace --activate
Navigate to
and fill in the replacement pattern:Search for: semicolon.no Replace with: semicolon.roztr.org
Click
. The operation will take some time.Reset permalinks
Navigate to
Notice what setting you have selected, so you can put it back later. Options are:
- Plain (Standard)
- Day and name (Dag og navn)
- Month and name (Måned og navn)
- Numeric (Numerisk)
- Post name (Innleggsnavn)
- Custom Structure (Egendefinert struktur)
If you are using a Custom Structure copy and save it.
Select the "Plain" setting, then click the "Save Changes" button. If you already have the "Plain" setting selected, choose "Day and name", then click the "Save Changes" button.
You will then see a message stating "Permalink structure updated".
Now, restore your original setting, and click the "Save Changes" button again. You are finished when you see the "Permalink structure updated" message again. Your site permalinks should now be working again. You may have to clear your browser cache before testing in order to see the change.
Source InMotionHosting.com: How to Reset WordPress Permalinks.
General cleanup
The following plugins are part of the WPengine environment and should be disabled and deleted. For details, see Manage plugins.
wp-content/mu-plugins/force-strong-passwords/
wp-content/mu-plugins/mu-plugin.php
wp-content/mu-plugins/slt-force-strong-passwords.php
wp-content/mu-plugins/wpengine-common/
wp-content/advanced-cache.php
- -
wpengine-security-auditor.php
wpe-wp-sign-on-plugin
wpe-wp-sign-on-plugin.php
The same goes for these if they are found:
wp-content/mu-plugins/stop-long-comments.php
wp-content/object-cache.php
Fix metadata for user #1.
Remove unused plugins and themes. Update those that remain.
Run health check.
Miscellaneous tasks
To get access to the admin account use wp in the CLI, or
alter the {users}
table in the database.
If the code base contains MFS resource forks (files with names
starting with “._
”, e.g.: “._README.txt
”),
they sometimes are included on page loads, showing a band of text
above the HTML that contains the string “apple.metadata” (see
screenshot below). These are useless on Unix and should be
deleted.

To search for them below the current directory:
$ grep -r "apple\.metadata" . | more
To delete them below the current directory:
$ find . -name "._*" -type f -delete
The following can safely be removed from the code base:
.git*
.sucuriquarantine
– Infected files._wpeprivate
– WPEngine stuffwp-content/mysql.sql
– WPEngine stuff- MFS resource forks (as discussed above)
ithemes.com:
What Files Should Be Excluded Within A WordPress Backup?
Themes used by Karde
- Avada 3.9.4 on MyLifeproducts.no.
Still available on ThemeForest. Current version 7.1. - Brunelleshi Child by Erlend Øverby on Semicolon.no, poseidon-project.org.
It is a child of Brunellechi ver. 1.6.5 - linked on ThemesInfo.com (but download link no longer works). - Catch Kathmandu 4.2.3 on cosymountains.com, pia-project.org.
Still available on wordpress.org. Current version 4.2.3. - Catch Kathmandu Child by Karde AS on FriTek.no Hverdagsteknologi.no.
Parent still available on WordPress.org. Current version 4.2.3. - Child 02 by Anonymous on Karde.no. Based upon Responsive 4.6.2
Parent still available on WordPress.org. Current version 4.6.2. - Lettere kropp by personlighyg on LettereKropp.no, LettereKropp-enkel.no. Based upon Symphony 1.0.8
Parent still available on WordPress.org. Current version 1.0.8. - Symphony 1.0.8 on Digimestring.no, Domoteus.no, PersonligHygiene.no, PersonligHygiene-enkel.no.
Still available on WordPress.org. Current version 1.0.8. - Symphony Child by Erlend Øverby on Laboris.no, JegVilStemme.no, PengerOgMeg.no.
Parent still available on WordPress.org. Current version 1.0.8. - Twenty Fourteen Child by Erlend Øverby on MobilMestring.no, UU-hjem.no, Klokbolig.no, Laboris-støtte.no.
Parent still available on WordPress.org. Current version 3.1. - Twenty Sixteen 2.4 on www.guided-project.eu.
Still available on WordPress.org. Current version 2.4.
Troubleshooting
Redirects
The the most common cause for redirects is HTTP Strict Transport Security (HSTS). To clear HSTS-settings, see the chapter about TLS.
If you experience that typing example.com
into the
browser's address fields forwards
to https://www.example.com/wp-signup.php?new=example.com
,
some values in the WordPress database may need adjusting-
This may be caused by the “ServerName” in the Apache configuration
file for the domain is not matching the domain and siteurl in
the {blogs}
, {site}
{options}
tables. Make sure they all match [2023 note: can't find this tables anymore, outdated?]:
Apache configuration: ServerName example.com WP Database: {blogs.domain} example.com {site.domain} example.com {options.siteurl} https://example.com
Test all combinations and make sure none redirects:
http://example.com RD https://example.com RD http://www.example.com OK https://www.example.com OK
Source SE.WPD: Site Redirecting to wp-signup.php.
If you experience site redirects to some other URL (typical to a legacy domain for the site), try to clear the browser cache. Here is how for differen browsers:
Chrome:
[TBA]
Edge:
[TBA]
Firefox:
Navigate
. Then look under "Cookies and Site Data" and click "Clear data". Make sure that "Cached Web Content" is ticked. Click "Clear".If you also tick "Cookies and Site Data", stored credentials are cleared.
Safari:
[TBA]
imagick
The WP Health Check may complain about:
“The optional module, imagick, is not installed, or has been disabled.”
To install and enable:
$ sudo apt install php-imagick $ sudo systemctl reload apache2
Source WordPress.org: PHP imagick.
WP-Pro-Quiz
The plugin WP-Pro-Quiz cannot be deleted from the GUI.
- Drop all tables starting with
wp-wp-pro-quiz
from the DB - Delete the plugin from the CLI.
No administrator access
"Sorry, You Are Not Allowed to Access This Page" https://stackoverflow.com/questions/11194028/plugins-menu-doesnt-appear-in-the-admin-panel https://wordpress.stackexchange.com/questions/313826/wordpress-address-url-option-missing-under-general-setting https://kinsta.com/knowledgebase/sorry-you-are-not-allowed-to-access-this-page-error-in-wordpress/Final word
[TBA]
Last update: 2020-10-20 [gh].