COAP:COAP-3110/week6: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Monday) |
||
Line 5: | Line 5: | ||
== Monday == | == Monday == | ||
'''Local preparation''' | |||
In order to migrate you will have to: | In order to migrate you will have to: | ||
* copy all the WordPress files using an FTP or SFTP client or a WebClient (depending on the hosting company) | * copy all the WordPress files using an FTP or SFTP client or a WebClient (depending on the hosting company) | ||
* dump the whole database to a *.zip file | * dump the whole database to a *.zip file, e.g. <code>w.zip</code> | ||
* Create a copy of the <code>wp-config.php</code> file and edit some settings | * Create a copy of the <code>wp-config.php</code> file and edit some settings (see below) | ||
'''On the new host''' | |||
Frequently, the hosting company will not let you create random database names since a same MySQL server is shared with many many users. You will have to use a specific tool from the control panel to create databases and database users. | |||
(1) Create a new database | |||
* Write down its full name, database user name, database user password, machine name | * Write down its full name, database user name, database user password, machine name | ||
* Edit config.php, the | |||
(2) Create a new wp-config.php file (but do not erase the old version yet) | |||
* Create a backup copy of wp-config.php, e.g. wp-config.local.php | |||
* Create a new copy of wp-config.php, e.g. wp-config.new.php | |||
* Edit config.new.php and configure it with the parameters for the new host. | |||
(3) import the w.zip file, using PhPMyAdmin or another client | |||
(4) Copy the wp-config.new.php file and rename it to wp-config.php | |||
Example taken from 000webhost.com: | Example taken from 000webhost.com: |
Revision as of 18:08, 13 September 2016
Week 6 learning goals
- Migrating from a development server to a hosting company
- The REST protocol
Monday
Local preparation
In order to migrate you will have to:
- copy all the WordPress files using an FTP or SFTP client or a WebClient (depending on the hosting company)
- dump the whole database to a *.zip file, e.g.
w.zip
- Create a copy of the
wp-config.php
file and edit some settings (see below)
On the new host
Frequently, the hosting company will not let you create random database names since a same MySQL server is shared with many many users. You will have to use a specific tool from the control panel to create databases and database users.
(1) Create a new database
- Write down its full name, database user name, database user password, machine name
(2) Create a new wp-config.php file (but do not erase the old version yet)
- Create a backup copy of wp-config.php, e.g. wp-config.local.php
- Create a new copy of wp-config.php, e.g. wp-config.new.php
- Edit config.new.php and configure it with the parameters for the new host.
(3) import the w.zip file, using PhPMyAdmin or another client
(4) Copy the wp-config.new.php file and rename it to wp-config.php
Example taken from 000webhost.com:
as you can see the hosting organization may force you to adopt some prefix, i.e. the a3966289
would represent your user id.
define('DB_NAME', 'a3966289_w');
/** MySQL database username */
define('DB_USER', 'a3966289_user');
/** MySQL database password */
define('DB_PASSWORD', 'XXXXXXXX');
/** MySQL hostname */
define('DB_HOST', 'mysql5.000webhost.com');
Trouble
- You provide may use an old mysql version that does not support the extend utf8mb4 caracter set. Open the *.sql file in a text editor and replace
utf8mb4
byutf8