How To Move From ImpressPages 5.0.3 To Demotic CMS 1.0 (Updated)
In the last 2 weeks I got an email on how to move from ImpressPages 5.0.3 to Demotic CMS. This article will at least detail on how you can move. Let's go!
1. Backup Your Database and Site Files
This cannot be stressed enough. Things happen. Your site could break during the upgrade or something like that. Thus it's good to backup your ImpressPages database and site files before running this upgrade.
2. Create A Demotic Instance
Now run the installation of Demotic 1.0 (download latest). This is just a small trick to get Demotic's configuration set up.
3. Upgrade Your ImpressPages Database
If you have the requisite DB Admin skills this is where the main task of upgrading will begin.
First, open up the "upgrade-0.0.sql" that is within the "Updates" folder in the Demotic CMS 1.0 folder. Follow the instructions on the comments above each SQL statement.
- First, convert your ImpressPages database's charset from "utf8_ci_general" to "utf8mb4_unicode_ci" by running this SQL statement:
ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Once that is done let's convert each of the database tables in your ImpressPages database to the same charset of "utf8mb4_unicode_ci" by running this SQL statement on each database table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Next, open the "upgrade-1.0.sql" file. Follow the SQL instructions to update the storage table options. This is very important for Demotic CMS to work.
4. Set the PageType Flag In Your ImpressPages Database 'Pages' Table
Now we need to set the 'pageType' column in your ImpressPages 'Pages' table. This column is really important since Demotic CMS delineates the page type based on whether it is a blog post or just a normal page. This way, Demotic's blogging feature will be able to detect blog posts correctly. To add this column runs this SQL statement:
ALTER TABLE `ip_page` ADD `pageType` ENUM('page', 'post') NOT NULL DEFAULT 'page' COMMENT 'The page type';
What if you have blog posts in your database prior to running this update? Unfortunately, those will get lost since this statement will set all the pages to the default 'page' flag. To recover your blog posts you'll need to run some more SQL statements. For example if you know the menu item under which your blog posts once resided under you can run this statement to set it as a blog post:
UPDATE `ip_page` SET `pageType` = 'post' WHERE id = 'page_id_here' LIMIT 1;
Then set all the pages under this menu to 'post' by running this statement:
UPDATE `ip_page` SET `pageType` = 'post' WHERE parentId = 'parent_page_id_here';
The 'parent_page_id_here' is the id of the menu that you just updated right before this statement and is the one under which these pages fall under.
Now your menu items and blog posts will be detected by Demotic CMS's blog.
5. Run SQL Updates To Set Up Version Number, Reset Cache and Blog Configurations
Run the other statements in the "update-0.0.sql" file to set the version number, update your cache and set up Demotic CMS' blog configuration.
6. Export the Updated ImpressPages Database File
Export the updated ImpressPages database file.
7. Import Updated ImpressPage Database File to Demotic's Database
Remember the Demotic CMS instance we installed at the start? Now drop the tables in this database then import the updated ImpressPages database SQL file into it.
8. Move Files From ImpressPages Instance To Your Demotic CMS Instance
Nothing has changed between Demotic CMS and ImpressPages Repository management module. Simply, copy the "files" folder from your ImpressPages instance to the new Demotic CMS instance that you created at the top.
9. Update "Config.php"
Now update the "config.php" file of your Demotic CMS instance. Things to change:
- Change the "tablePrefix" to "ip_" or the database prefix that your ImpressPages instance used to use.
- Edit the 'database', 'username', 'username' and 'hostname'.
10. Change The Login URI to Your Admin Backend
This is optional. With Demotic CMS you can define the login URI to your administration backend. By default, during installation, the login URI to your backend is set to 'secret-login'. To change it edit your "config.php" file and update the 'loginURI' to the setting you would prefer.
11. Additional Settings Changes
You need to prevent errors from being printed once you deploy to production. Simply change the 'developmentEnvironment' and 'showErrors' to '0' before deployment.
12. Test, Test, Test
Finally test to see if everything is working right.
Upload everything to your server. Also import the database to the database server of your website.
That's it. Happy creating pages and blogging!