Blog

Drupal to WordPress Migration Tool

The Drupal to WordPress Migration Tool exports the bulk of the content from Drupal 6 to WordPress 3.5. It runs a series of MySQL queries to read information from a Drupal database and convert the content to WordPress. Please see this post for some background on the project.

A web front end is available for very basic Drupal installations. Sample SQL queries are included for more complex setups. It is an open source project released under The MIT License and hosted on GitHub.

The Drupal to WordPress Migration Tool shows how I like to structure code but since it’s an on-going project, it should be considered alpha code. (It uses HTML, JavaScript, jQuery and PHP but should be considered alpha code.)

Q: What do you need to get started with migrating a site from Drupal to WordPress?

The minimum requirement is some sort of access to your Drupal database. For security, we’d prefer not have access to your live servers so a compressed MySQL database dump file of your Drupal site is ideal. If you have no-one to create the database dump file, we can create one on your behalf by logging in to your MySQL control panel or database server.

In the cases of large databases, we’d need to work directly on your server since transferring dump files of many gigabytes is impractical. A good practice would then be to clone the database and give us a separate login to the server. That way we won’t have to touch your live server and data.

An admin login to the Drupal control panel on a clone of your site would be useful for fine-tuning and debugging. This is normally not necessary for the first test export.

We generally take care of setting up the entire development environment on our servers. This includes creating an empty WordPress site for displaying results and for some complex migrations, a clone of your Drupal site for analysis. If you have limited budget, you can save on fees by providing us with the development environment set up and ready to use.

Q: How much will it cost to migrate my site from Drupal to WordPress?

Please see my dedicated migration site for the latest pricing.

Since there are so many variations between Drupal installations, it’s not practical to give reliable cost and time estimates from the outset.

We really only start to understand the scope of the work after running the first few exports. Furthermore, the modules installed during the life of your Drupal site may have altered the structure of the database. This affects how cleanly we can run the migration and how many adjustments will be necessary.

Nevertheless, you remain the driver of how much work we put in. Some site owners request lots of adjustments while others are happy to have just a few aspects of their old site migrated. The biggest factor affecting the budget is therefore the amount of communication needed with regard to the adjustments.

For the bottom-end migration, all we need to do is run through our migration script. You take care of everything else, including setting up the development server. We charge more if you have very rigid requirements which involve writing lots of code to automate tasks.

Read more about our migration process and how it may affect your budget.

Q: What is your process for Drupal to WordPress migrations?

The whole migration process is very much an iterative process of fine tuning until you’re satisfied with the end result. We call each iteration a ‘pass’ because we pass through the database with our migration script repeatedly, making slight adjustments as we gather more information.

Since there are so many variations between Drupal installations, we really only start to understand the scope of the work after running the first few exports. Our process starts off as follows:

  1. You let us know your requirements and give access to your site’s database;
  2. We run a test export and show you the result using a standard WordPress installation;
  3. You let us know how much more fine-tuning is needed.

So for example, we’d run through the first pass and ask you to take a look at the content. You let us know if you discover any issues, like missing posts or meta information (e.g. tags, authors and dates). We then adjust the migration script and run another pass. This repetition continues until you decide it’s good enough.

Why would there be missing information? The number and type of modules you’ve installed during the life of your Drupal site could have effected the structure of the database. This then affects how cleanly we can run each pass of the migration. For example, one client installed a module that ended up silently duplicating certain tags. We had to write custom code to remove duplicates and merge the associated posts. All of this took a great deal of time.

There’s rarely a ‘perfect’ migration due to the differences between the how Drupal and WordPress store the data for your site. Often, ‘good enough’ is a compromise between your budget and how close the WordPress version is compared to the original site. It’s not always possible to get an exact copy in WordPress, especially for more complex Drupal installations.

In fact, it’s usually too expensive to be overly specific about what gets migrated over because we’d write code and debug custom rules. We generally recommend bulk migration of only the aspects that would be tedious to do manually, then getting a human editor to ‘eyeball’ the content to make very specific changes using the WordPress user interface. It’s a boring job for the content editor but it tends to be cheaper and more accurate way of polishing off the migration.

Emergency Plan for iPhone to improve preparedness in the Philippines

FOR IMMEDIATE RELEASE

London, UK: Another Cup of Coffee Limited, a London-based web development company, aims to improve emergency preparedness in the Philippines with the launch of Emergency Plan for iPhone. The app is a simple tool designed to store an emergency plan for an earthquake, flood, typhoon or similar event. Valuable for families who want to ensure their households are prepared to handle a crisis, it can also be used by employers to issue staff with company emergency procedures.

Existing apps tend to offer alert services geared for crisis management professionals or provide standard guidelines easily found online. In contrast, Emergency Plan for iPhone allows ordinary users to save a plan that’s appropriate for their own family or work environment. Its straightforward interface delivers only the important information without unwanted distractions.

Despite the Philippines being highlighted as among the most disaster-prone countries, many Filipinos are still caught off guard by extreme weather events. Founder Anthony Lopez-Vito, who is a British-born Filipino, said, “When Typhoon Yolanda struck, my friends and colleagues with family in the area didn’t know how to find their loved ones. I thought it would be great to have an app people can use for planning before another crisis.” After an unsuccessful search for something suitable, Mr Lopez-Vito decided to build an app to meet the need. He continued: “These days, mobile phones–especially iPhones–are quite common but most apps are for preppers. Since your phone is a constant companion, it makes sense to use an app to keep the important elements of your plan with you at all times.”

Emergency Plan is an iPhone app version of a paper-based emergency plan card. Although electronics may not be useable in a prolonged calamity, it is intended for the immediate unfolding of a crisis. Emergency Plan for iPhone is free for a limited time to gather feedback and make improvements.

Download Emergency Plan for iPhone on the App Store

###


Links and media downloads:

About Another Cup of Coffee Limited:

Another Cup of Coffee Limited is a web development company based in London, England. Founded in 2006, it creates and manages websites for small businesses, media agencies and not-for-profit groups around the world. Although incorporated in the United Kingdom, its talent is made up of independent professionals, many of whom are based in the Philippines.

Contact:

Mr Lan H. Lam
Another Cup of Coffee Limited
Phone: +44 (0) 20 3 290 8898
Email: [email protected]

Editing your WordPress site

Here’s a primer to editing your WordPress site. More detailed information can be found on the WordPress help pages but this should get most clients started quickly.

1. First log in

To login to your WordPress site, go to http://yourdomain.com/wp-admin. (Replace yourdomain.com with the domain for your site.) You will be presented with the login screen.

help-wp-login

Enter the login details you were sent after your site was launched. If you’re logging in for the first time, please remember to change your password under the Users > Your Profile menu item.

 

2. The Dashboard

After logging in, you should see the WordPress Dashboard. If you don’t see the screen below, hover over your site name on the dark menu bar at the top of the screen. You will see an option to switch between Dashboard view and Site view.

help-wp-dashboard

  1. Site name menu allows you to switch between Dashboard view and Site view.
  2. Hovering over your username will allow you to log off.
  3. Click the Posts menu item to view, edit and create new posts.
  4. Click the Pages menu item to view, edit and create new pages.

This WordPress article gives a good overview of the differences between pages and posts.

 

3. Editing content

You can add new content or edit existing ones. Click on the Posts or Pages menu item on the left and either select existing content you want to edit or click Add New.

The editing controls will be quite familiar if you’ve used a word processor like Microsoft Word or Apple Pages.

help-wp-edit-page

  1. The Visual and Text tabs allows you to switch between visual editing with toolbars and HTML coding. If you don’t know how to code web pages, make sure you’ve selected the Visual tab to bring up the editing toolbar.
  2. The editing toolbar works just like a word processor. Highlight your text and select the format option on the toolbar.
  3. Type your text in the text editing are.
  4. Click Publish or Update.

 

4. Logging out

For security, it’s best to log out after completing your edits. If you decide not to log out, you’ll see the WordPress menu bar at the top of your site whenever you visit. This will only be visible to you and other content editors who are logged in. Normal visitors will not see the WordPress menu bar.

WordPress is quite simple to use so this short guide should cover the majority of day-to-day content management tasks for most of our clients under a maintenance package. For help on anything specific to your site, please contact me.

Drupal to WordPress migration notes

These Drupal to WordPress migration notes are intended for clients who are handling some aspects of the migration themselves. Users of the Drupal to WordPress Migration Tool or MySQL queries might also find information here to resolve some problems.

Admin account password and email address

Your content management system (CMS) administrator password and email address may have changed during the migration to help with debugging. Please update them as soon as possible.

Drupal and WordPress user passwords are encrypted and I do not have access to them in plaintext. However, for your peace of mind, I recommend that you also ask all your users to reset their passwords.

Server credentials

Please remember to change any database, (S)FTP, SSH server and control panel credentials you may have given me.

Working tables

During the migration process, I may create some working tables to hold temporary data. My naming convention for the working tables are as follows:

  • acc_ prefix: these are working tables created to help with migrating data.
  • backup_ prefix: these are backups of existing tables prior to migration, for example from a previous installation of your CMS. These will not be altered during the migration process.
  • _copy postfix: duplicates of WordPress tables copied for debugging will have a _copy postfix. These are different from the backup_ tables in that they may have been manually altered.

These working tables are not used by WordPress so you may safely delete them. However, it’s advisable to keep them for a short while as they may be useful in case we need to debug any issues that crop up.

Migrating to a live server

Most Drupal to WordPress migrations are performed on a test or development server. For help on how to move WordPress to your live server, please see: WordPress Codex: Moving WordPress.

Troubleshooting common errors after a site migration

Please see below for some common problems you may experience after migrating your Drupal content to a new WordPress site.

Incorrect domain in URLs

WordPress stores domains in the database. If you performed the migration on a local or development server, there’s a good chance that the links will be incorrect after migrating to your live server. Use the Interconnect IT utility to run a search and replace on your database. This will also correct changed database prefixes.

More information can be found on the interconnect/it Search Replace DB page.

“Sorry, you are not allowed to access this page”

If you try to log in via wp-admin and receive this error, you may have overwritten the administrator user’s wp_capabilities or wp_user_level.

Set the correct meta_value using the following SQL:

UPDATE wp_usermeta 
    SET meta_value = 'a:1:{s:13:"administrator";s:1:"1";}'
    WHERE user_id = 1 AND meta_key = 'wp_capabilities';

UPDATE wp_usermeta 
    SET meta_value = '10'
    WHERE user_id  = 1 AND meta_key = 'wp_user_level';

Remember to use the appropriate the user_id.

“You do not have sufficient permissions to access this page”

If you receive this error after logging in to your new WordPress installation, it’s possible that the database prefix on your new WordPress site is not set correctly. This may happen if you move your WordPress installation to a host that uses a different database prefix.

Try running one of the queries below. Replace wp_new_usermeta, oldprefix_ and newprefix_ as appropriate.

Option 1:

UPDATE wp_new_usermeta SET meta_key = REPLACE(meta_key,’oldprefix_’,’newprefix_’);

UPDATE wp_new_options SET option_name = REPLACE(option_name,’oldprefix_’,’newprefix_’);

Option 2:

update wp_new_usermeta set meta_key = ‘newprefix_usermeta’ where meta_key = ‘wp_capabilities’;

update wp_new_usermeta set meta_key = ‘newprefix_user_level’ where meta_key = ‘wp_user_level’;

update wp_new_usermeta set meta_key = ‘newprefix_autosave_draft_ids’ where meta_key = ‘wp_autosave_draft_ids’;

update wp_new_options set option_name = ‘newprefix_user_roles’ where option_name = ‘wp_user_roles’;

Please note that these queries may not work for you. Success depends on your specific setup.

For more information, please see the following pages:

“Unable to establish database connection”

The database credentials are correct but you see an “Unable to establish database connection” error. Check that wp_options table is not empty.

Allowed memory size exhausted

  1. Increase php.ini memory size
  2. Increase WP settings memory limit with:
    define(‘WP_MEMORY_LIMIT’, ‘128M’);

Post migrated but navigating to post shows blank page

The post is visible in the dashboard but viewing it displays a blank (but themed) page. Manually saving it on the dashboard makes it appear.

It’s possible that the problem posts need to be assigned to a category.

Post migrated but navigating to post shows ‘Not found’ error

The post is visible in the dashboard but viewing it displays a ‘not found’ error. Manually saving it on the dashboard makes it appear.

  1. Check that the url contains valid characters for a WordPress slug.
  2. Check that .htaccess is enabled in your Apache configuration

Link to author 404

Posts exist but link to the author’s post listing page is broken.

Check user_nicename in wp_users WordPress table. Make sure the nicename doesn’t contain invalid characters such as spaces, periods.

Dashboard controls not visible after logging in

If you are able to log in as an administrator user but do not see the Dashboard controls, check your table prefixes. If the table prefixes changed during the migration, you may have forgotten to update the options and usermeta tables.

Check where the old prefixes have been set:

SELECT * FROM `wpnew_options` WHERE `option_name` LIKE '%wp_%';
SELECT * FROM `wpnew_usermeta` WHERE `meta_key` LIKE '%wp_%';

Updated the prefixes. For example:

UPDATE `wpnew_options` SET `option_name` = 'wpnew_user_roles' WHERE `option_name` = 'wp_user_roles';
UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_capabilities' WHERE `meta_key` = 'wp_capabilities';
UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_user_level' WHERE `meta_key` = 'wp_user_level';

UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_user-settings-time' WHERE `meta_key` = 'wp_user-settings-time';
UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_user-settings' WHERE `meta_key` = 'wp_user-settings';

Further help

We’ll be very happy to provide support you if have difficulties after migration. For a quotation, please contact us. We also offer customised hosting and maintenance packages. Please ask for details.

Safeguard your email address by registering a domain

A primary email address tied to your email provider could set you up for a great deal of inconvenience if they shut down. Registering your own domain helps control your email regardless of which company you’re currently using.

On Thursday, 8th August 2013, a secure email service provider called Lavabit suddenly suspended operations. Its founder, Ladar Levison, wrote in an open letter on the company’s website that he would rather shut the company down than “become complicit in crimes against the American people.” Although Mr Levison took what he believed to be a principled stand, Lavabit customers were understandably angry at being blocked from accessing their emails. Without warning, long-time customers lost years worth of archived messages. Active users who relied on the company to host their primary email now face the inconvenience of updating their contacts and online accounts with a new address.

One may be tempted to think that a simple solution would be just to set up another email account elsewhere. After all, there are many free email providers offering reliable services. If you’re in this camp, ask yourself how your day-to-day life will be affected if you suddenly and unexpectedly lose access to your email account.

  • Do you conduct business over email? How much productivity will be lost re-establishing communication with clients?
  • Have you saved passwords, document attachments and important account information in your webmail folders? What happens if you can’t log in to the webmail account?
  • How much time will it take to inform all your relatives, friends and contacts of your new email address, especially if your address book was also hosted with the lost email service?
  • How easy is it to reset the passwords of your other online accounts (internet banking, Facebook, Skype, etc.) without that lost email address?

Keeping control of your email address

There are some important lessons we can learn from the Lavabit incident and two things can save you from similar trouble:

  1. Register your own domain and link it to your email provider. That way, you can switch providers while retaining the same email address.
  2. Do not rely on webmail as your only method of accessing your messages. Set-up an email client on your computer and regularly download copies of your email.

Exactly how you go about using your own domain and downloading emails depends on your existing set-up and requirements. I’ll give a quick overview in this post but please note that it only briefly touches on some steps which can be quite technical.

Step 1: Register your own domain

An email address under your own domain keeps it independent of the email host. Your current email provider may go out of business, get bought-out or become unreliable but having your own domain means that you can switch to another while retaining the same email address.

To get an email address under your own domain, you first need to register a name with a domain name registrar. (See this post for more information.)

You can register your domain with the following companies but a web search for “domain registration” will bring up a list of other providers:

  • Another Cup of Coffee Limited – we’ll handle the details of domain registration under your name for £9.99 GBP per year
  • 123-reg.co.uk – a popular UK-based registrar and hosting company
  • namecheap – a US-based registrar that seems to have a good reputation for customer service (I personally haven’t used them)
  • Network Solutions – one of the oldest and well-known registrars but quite expensive

Regardless of which domain registrar you choose, the whole process should only take a few minutes to complete. However, depending on their system, it could take a few hours to a day or more before it’s available for use.

Step 2: Link your domain to your email provider

Linking your domain to an email provider can be intimidating for non-technical people. To make matters more complicated, some end up with different combinations of registrar, free web-based email, business email hosting, and web hosting. Everything can be under one roof or you may have different companies handling each component. The exact steps needed will depend on your subscription packages so covering them in a short tutorial is not practical. (That’s why companies like us exist!)

In general, your registrar will give you an online control panel. This lets you specify settings to hand over control of the domain’s email to an external email provider. Alternatively, it may offer an email forwarding service that automatically redirects messages to another address, such as Gmail or Yahoo Mail.

Changing email providers then becomes a matter of adjusting the control panel to reflect the new company’s settings.

Here are some help pages for a few of the popular email providers:

Step 3: Download backups of your emails

For many people, their main method of checking and sending email is through their provider’s webmail interface. It’s very convenient because there are no programs to set up on your computer. All that’s needed is to open up a web browser and log in. The downside is that you do not retain any copies of your messages. As some of the Lavabit customers found, you will lose everything if the provider suddenly ceases operations.

The solution is to set up an email program (also known as an email client), like Mac Mail, Microsoft Outlook or Mozilla Thunderbird to download emails from your server. Even if you prefer webmail, periodically connecting from your email client ensures that you save the latest messages on your computer’s hard-drive.

Most email providers offer you a choice of ‘POP’ or ‘IMAP’ as mechanisms for retrieving your email. POP will simply download all the messages and if set in your email client, delete the messages after they’re read. IMAP synchronizes your email client with the server so it copies the same structure of read, unread, sent messages and saved folders. (This Rackspace article gives more detail on the difference between the two.) I find IMAP to be the most convenient option. If you mostly use webmail, you should also use IMAP if it’s available.

Too much trouble?

These steps might seem daunting but you don’t need to be a computer expert to get everything set-up. Business users usually have more complex configurations that may need an IT administrator to get everything working properly. However, for personal users and micro-businesses with simple needs, a little bit or research and background reading should allow you to get the job done without any help.

Of course, if you’d rather not go to the trouble of doing this yourself, we’ll be very happy provide you with a quotation. This is not a big budget job as the whole process is fairly quick for those familiar with what’s required.

Some background on the Lavabit incident

I’ll make a slight digression from technical matters as the Lavabit incident may have wider implications for anyone using US-based internet services.

Lavabit offered encrypted email services and was reported in the press to have been used by the NSA whistleblower Edward Snowden. Unlike most email systems, the company’s technology meant that there was no way for them to directly read user emails. While we may never know the truth, it seems likely they were ordered to participate in ongoing surveillance in a form that the founder believed to be against the United States Constitution. Levison was issued with a ‘gag order’ preventing him from giving details on the matter. Shortly after the Lavabit news broke, Silent Circle, another secure email provider, pre-emptively shut down its own service in order to protect its customers.

There is increasing industry speculation that the US government’s surveillance is jeopardizing the country’s businesses since they can no longer be trusted to protect their users’ privacy.

It’s clear that no matter which country you’re in, if your email is hosted with a US provider, you need to assume that the US government will want (or already has) backdoor access to them. Whether or not this is acceptable is a discussion outside the scope of this post. Regardless of where you stand, it’s important to realize that the industry landscape is changing and we can no longer be complacent about safeguarding our data.

Now accepting Bitcoin for payments

I’d installed a Bitcoin wallet back in 2010 but at the time there wasn’t much of a market for Bitcoins. With all the publicity the technology has been getting lately, now seems like a good time to do some more experimentation. Part of that includes seeing if it’s practical to accept them as a form of payment.

The exchange rate is quite volatile right now so I’ll start off slowly and open this up to selected projects only. If you’re interested in paying for your project in Bitcoins, please drop me a note and we’ll work out the details.

For those who are interested in Bitcoin and would like to know more, here’s where to start:

(1) Get an overview at

(2) Install a BitCoin wallet. I went with Bitcoin-Qt.

(3) After installation, wait for your wallet to sync with the network. Warning: this could take days!