Migrate Drupal 6 to Drupal 7

tutuploads1_9a01976bcb0177f97c97f4fdbb1ac351.png

Changing from Drupal 6 to Drupal 7 is not just a simple update. The steps seem straightforward, but there are major changes in the way Drupal 7 works and stores data. So a move up across major version numbers is really a “migration” as opposed to a simple update or patch.

If your site is fairly simple, with good backups, and you use the right approach, you can accomplish the migration without too much trouble.

The more complex your site is, the more complex the migration will be.

Doing a migration involves several steps. You might want to review these related tutorials.

Step 1: Backup your site’s database

tutuploads1_9a01976bcb0177f97c97f4fdbb1ac351.png

* It is wise to try an update or upgrade on a test copy of your site before applying it to your live site. Even minor updates can cause your site’s behavior to change.

There is a handy tool called Backup and Migrate, which helps simplify the backup process, which you can download from this page http://drupal.org/project/backup_migrate. Note: it only works with MySQL, and is still under development. You should also do a manual backup of your database using phpMyAdmin. We show you how to do this in this tutorial.

Step 2: Backup all your folders and files

You have several ways to do this, and you might want to do it more than one way for safety

  1. You can download all the files to your local computer
  2. Copy the files to another directory on your server
  3. Use the backup facility that is probably built into your hosting control panel

You can’t be too paranoid about having extra copies.

Step 3: Double check to make sure you can complete the upgrade

Check on the Drupal 7 status of your contributed and custom modules and themes.

Step 4: Check for the latest version of Drupal 6.x

tutuploads4_78cc6a39019111ff812b3d9ebb947ab1.png

You can’t skip versions when you upgrade. For instance you cant go from 6.0 to 6.2 in one step. You also can’t upgrade directly from 6.0 or 6.1 to Drupal 7. You have to have your Drupal 6 installation at the latest level.

How do I know which version of Drupal I’m running?

  • Go to Administer (or Administration) >> Reports >> Status report.
  • You will see your version number if you have Drupal 6.0 or later. In Drupal 5.x and earlier, the path to go to is Administer >> Logs >> Status report.

Where do I get the latest version of Drupal 6? http://drupal.org/project/drupal

Step 5: Take the site off-line

tutuploads5._Take_the_site_off_line..png

Go to Administer >> Site configuration >> Site maintenance.

tutuploads5.png

Select “Off-line” and save the configuration.

Step 6: Change the theme to Garland

tutuploads6._Change_the_theme_to_Garland..png

Go to Administer >> Site building >>Themes

tutuploadsmedia_1312655385441.png

Click the check box to enable the theme, and the radio button to make it the default. Scroll to the bottom of the page and save changes.

You need to use the basic theme. If you are using a template, check with the designer to see if there is an updated version, and you can do that upgrade after the site is working with Garland.

Step 7: Disable all non-core modules

tutuploads6._Go_to_the_modules_page_and_disable_all_non-core_module.png

Go to Administer >> Site building >> Modules.

tutuploads7._Disable_all_modules_that_are_not_listed_under_Core_-_r.png

You can expand the categories by clicking on the category name and see what is enabled. If you added an additional modules to your site, there will be additional categories. Expand them and uncheck the boxes next to the modules

Step 8: Clear all optional module check boxes

tutuploads8._Clear_all_optional_module_check_boxes_and_save_the_cha.png

It is possible that some modules cannot be immediately disabled, because others depend on them. Repeat this step until all non-core modules are disabled and all check boxes are clear. Be sure to scroll to the bottom of the page and save the changes.

Step 9: Remove unwanted modules

tutuploads9.png

If you know that you will not re-enable some modules for Drupal 7.x and you no longer need their data, then you can uninstall them under the Uninstall tab after disabling them. The Uninstall tab is at the top of the modules page.

Step 10: Remove sites/default/default.settings.php

tutuploads10._Remove__sitesdefaultdefault.settings.png

On the command line or in your FTP client, remove the file /sites/default/default.settings.php

Step 11: Delete all your other folders and files except /sites/

tutuploads11._DO_NOT_DELETE_the_sites_folder__but_go_ahead_and_dele.png

Empty your Drupal files directory except for:

  • /sites/
  • any custom files you added elsewhere.

If you made modifications to files like .htaccess or robots.txt, you will need to record those changes and re-apply them after the new files are in place.

Step 12: Remove unwanted module folders

tutuploads12.png

If you are abandoning any modules because they are not compatible with Drupal 7, remove them from the directory
sites/all/modules

Step 13: Download and extract Drupal 7

tutuploads13._Download_and_extract_Drupal_7__then_copy_all_the_file.png

Download Drupal 7 if you haven’t already. http://drupal.org/project/drupal

You can extract the files on the server and copy them to your main directory. Alternately you could extract them on your local computer and use FTP to move them to your sever.

Don’t worry about overwriting the files in the sites folder. Only the files that need replacing will be replaced.

Step 14: Reapply any changes to your .htaccess file or robots.txt files

tutuploads14._Reapply_any_changes_to_your_.png

Re-apply any modifications to files such as .htaccess or robots.txt. Use a text editor to make changes.

Step 15: Make your settings file writable

tutuploads15._Make_your_settings_file_writable.png

Make your settings.php file writable, so that the update process can convert it to the format of Drupal 7.x. settings.php is usually located in sites/default/settings.php

Normally this would best be set at 444, but it needs to be writable so 644 or 666 if you are having trouble will be the correct setting. BE SURE YOU REMEMBER TO COME BACK AND RESTORE THIS SETTING AFTER YOU ARE FINISHED with the migration.

Step 16: Run update.php

tutuploads16._Run_update.png

Run update.php by visiting http://www.example.com/update.php (replace www.example.com with your domain name). This will update the core database tables. Click continue and follow the steps.

 If you can’t access update.php make a change to your settings file:

tutuploads17._If_you_can_t_access_update.png

If you are unable to access update.php do the following:

– Open settings.php with a text editor.

– Find the line that says:
$update_free_access = FALSE;

– Change it into:
$update_free_access = TRUE;

– Once the upgrade is done, $update_free_access must be reverted to FALSE.

Step 17: Backup your new database

tutuploads18.png

Using the same procedure you used before, make another database backup. Save it with a different name or to a different location than your original backup. You may still need that one.

Step 18: Upgrade your modules to their newer versions.

You’ve gone through the core upgrade, but now each module has to be upgraded. Then you can update and re-enable your non-core modules by following these steps:

  1. Check your notes, and the UPGRADE.txt files inside each module, to see if any special upgrade instructions apply
  2. Fully remove the old module directory inside sites/all/modules/ (if you haven’t already)
  3. Download, unpack and move the new module directory to sites/all/modules/
  4. Enable the module
  5. Run update.php again (you should have run it once already when upgrading core) and check for any message output.
  6. Back up your database and files again, between each module update, so that if there is a problem, you can revert to the most recent update.

If you have errors when you run the update.php script:

  1. Note any error messages you see.
  2. Restore your site to its previous state, using the file and database backups you created before you started the upgrade or update process. Do not attempt to do further updates or upgrades on a site that had update problems.

Step 19: Upload your Drupal 7 compatible theme

tutuploads20.png

Make sure everything works in the Garland theme before you switch over to your Drupal 7 theme.

Step 20: Go to Reports and run a Status report

tutuploads21.png

16. Go to Administration >> Reports >> Status report. Verify that everything is working as expected.

Step 21: Set update_free_access is set to false

tutuploads22.png

Ensure that $update_free_access is FALSE in settings.php.

tutuploadsmedia_1312661333788.png
  • Go to Administration >> Configuration >> Development >> Maintenance mode.
  • Disable the “Put site into maintenance mode” check box and save.

tutuploadsmedia_1312661436093.png

Scroll to the bottom of the page to save the configuration.

That should be the last step in your successful migration from Drupal 6 to Drupal 7.

Related Tutorials:

Planning for a Drupal 6 to Drupal 7 Migration

How To Put Drupal 7 In Maintenance Mode.

Migrating Drupal 6 CCK Data To Drupal 7 Fields

Author

0 0 votes
Article Rating
Subscribe
Notify of
21 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Mark Sporr
Mark Sporr
12 years ago

Thank you for a well presented tutorial on upgrading from 6 to 7. I believe I faithfully followed your guide but finished up with one oddity I can’t fathom.

If you install Drupal 7 afresh, the header of many of your administration pages contain descriptive text. But the same admin pages on my upgraded version do not show this descriptive text.

Why is this? Is there a setting somewhere that I have missed?

Regards

Mark Sporr

Nick
12 years ago
Reply to  Mark Sporr

Hi and welcome, Mark!

Sorry for the inconvenience, but if you’re a student at OSTraining, could you copy and paste this into the support forum so one of our support techs can look into it for you? All you have to do is log in at [url=http://www.ostraining.com]www.ostraining.com[/url] and click on Support Forum in the main menu.

Please see the support FAQ for more information:

[url=http://www.ostraining.com/support-faq/]http://www.ostraining.com/s…[/url]

Kind regards,

Nick

Mark Sporr
Mark Sporr
12 years ago

The resolution requires a few steps, in different parts of your admin area, as follows:

In the Appearance section

Make sure the Seven theme is enabled (just enabled, not necessarily set as default).

Lower down, set “Seven” as your administration theme.

In Structure >> Blocks

Under Help choose to “configure” System Help block.

On the configuration page ensure that the entry headed “Seven (administration theme) is changed to the option “Help”

The descriptive text at the head of many of your admin pages should now be displayed.

Regards

Mark Sporr

Nick
12 years ago
Reply to  Mark Sporr

I’m glad you got it sorted, Mark! Great job! 🙂

Kind regards,

Nick

you can skip
you can skip
12 years ago

You can upgrade from 6.0 do 6.22 in one step. You do not have to do all steps on atfter another. Same is with modules.

install.php file strores info on all upgrade procedures in the history of the project in it’s version ie 6.x and will launch all those which have not yet run on your site, one after another.

Garry Freemyer
Garry Freemyer
12 years ago

When I visited my site to run update.php I got a blank screen and viewing the page source showed in an unfinished SHTML Tag “Server error 500” or something like that.

Trying again just produced random errors.

I checked permissions on sites, settings.php etc, opened them wide, I did everything exactly as described in the post. I’ve followed the instructions so many times restoring and trying again that I could re-write this entire blog in my sleep … yet it doesn’t work and nothing on google helped.

Nick
12 years ago

Hi and welcome, everyone!

Sorry for the inconvenience, if you need support and you’re a student at OSTraining, could you copy and paste this into the support forum so one of our support techs can look into it for you? All you have to do is log in at [url=http://www.ostraining.com]www.ostraining.com[/url] and click on Support Forum in the main menu.

Please see the support FAQ for more information:

[url=http://www.ostraining.com/support-faq/]http://www.ostraining.com/s…[/url]

Thanks!

Kind regards,

Nick

Dmitry Salnikov
Dmitry Salnikov
12 years ago

Thanks for great post.

Nick
12 years ago

You’re welcome, Dmitry!

Kind regards,

Nick

Rosa
Rosa
12 years ago

Muchas gracias, muy completo y bien explicado.

Saludos

Andre
Andre
11 years ago

Excellent! Thanks for getting me thru these trying times of D6 to D7 upgrades. 🙂

keving_65
keving_65
11 years ago

Very nice – thank you!

Note: In Step 10, the image suggests that one should delete the settings.php file instead of the default.settings.php file as the text correctly says.

alex23
alex23
11 years ago

i thought version 6 is more popular, coz some websites are still using version 6.

Yannick
Yannick
10 years ago

Step 10 says “Remove settings.php” and then step 15 says “Change permissions of settings.php so Drupal can change it to D7 format”… that’s kind of confusing.

gauravjeet
gauravjeet
10 years ago

i think it means that settings.php file already in drupal 6 setup usually has read-only permissions, so change these read-only permission to read-write so that while updation takes place, it can change settings.php file to drupal 7 format

Bell brown
Bell brown
10 years ago

Nice post,I am not aware about this information.Its really informative and helpful.Thanks for sharing such informative post.

[url=%20http://www.paulmckeown.co.uk/]Drupal 7 Developer London[/url]

NadsH
NadsH
9 years ago

Hi,

This is certainly very helpful and a good one, although none of this leverages Drush. Is there an updated tutorial or any link that points to doing some of the tasks here using drush.
Thanks.

elizabeth
elizabeth
7 years ago

i think it means that settings.php file already in drupal 6 setup usually has read-only permissions.

Dave
Dave
7 years ago

Need to edit d7 settings.php to use the d6 database and then run update.php, right? Or do you just use the same d6 settings.php and it gets updated by running update.php?

daniel-pickering
7 years ago
Reply to  Dave

You make the D6 settings.php file writable so that it can convert the file to the D7 version.
Thanks

Daniel

Umair
Umair
4 years ago

How to convert a D6 module to D7? I want to convert this

https://www.drupal.org/project/kannel

21
0
Would love your thoughts, please comment.x
()
x