LunpaCMS Whipping your website into shape! Introducing Lunpa, our mascot.  Her mother was a hamster and her father was Chilean M00se.  Oddly, neither smelt of elderberries.


Migrating Wordpress sites to LunpaCMS

Basic Information

The Wordpress migration tool is designed to help transition from Wordpress to LunpaCMS, especially for a compromised site, when fully cleaning your website is cost-prohibitive or when it is not known to what extent the attacker has added backdoors to allow re-infection of your site. Currently the script features the following:

Articles will be carry the correct timestamp field, however users will be coerced in LunpaCMS to admin, with the original author written in the post body.

Getting Started

If you are importing to an existing LunpaCMS site, you should do a complete backup of your website before you begin:

% mysqldump examplesitedb > lunpa_site_db.bak.sql
% tar acvf lunpa_site_backup.tar.gz /htdocs/examplesite.com/html/

While this script does not modify any Wordpress files, backups are always a good idea:

% mysqldump --add-drop-table wordpress_database > wordpress_db.bak.sql

Run the Script

The import script is included as part of the standard LunpaCMS distribution, located in sitetoolsmanager/wordpress_migrate.pl.

Usage: ./wordpress_migrate.pl [OPTIONS] SITENAME

Required Options:
  --database - database to connect to.
  --my-cnf   - path to my.cnf file containing database information for
               Wordpress installation.
  --base-dir - path to wordpress root directory.

Other Options:
  --output-dir - output directory for Wordpress content. Defaults to
                 'lunpacms_wordpress_migration_output'.
  --force      - Skip checking the database version and files.
  --help       - display this message.

Be sure the MySQL .cnf file you specify with --my-cnf includes a [section] for your Wordpress database that matches --database.
--base-dir should point to your webserver Wordpress install. The script will check for common Wordpress files in the directory specified, but this check can be skipped by using the --force option.

If no --output-dir argument is specified, lunpa_wordpress_migration_output in the current working directory will be used instead.

Finally, specify the sitename as the last argument, omitting the http://, www, and trailing slash, leaving only the domain. (i.e. 'example.com').

Running the script should generate .template files in your output file, and store the SQL for importing blog posts in blog_posts.sql. Inspect these files before running the commands specified by the script output to complete the import. Note that not all links may have been transcribed, so each page will need to be visually inspected after being imported.

Note about Importing Templates

Due to issues with php integration in varoius Wordpress templates, the look and feel for the website must be imported by hand to avoid security issues. As such, templates and custom plugins are ignored by this script.



Copyright © 2024 Peregrine Computer Consultants Corp. All rights reserved.

About Lunpa, our mascot. Her mother was a hamster and her father was an ill-tempered Chilean M00se. Oddly, neither smelt of elderberries.
The artist is Jennifer Lomax.