Looking to move a huge Wordpress blog to Hugo

Wordpress is giving me a lot of troubles, the backend of my site is bloated, it’s slow, goes down frequently etc and I want to move to hugo. I tried Hugo and loved the simplicity, speed, the directory formats and the ease of everything.

The problem is the wordpress site is huge. 70,000 posts and nearly 1 million images. I have all the entire wp-content file containing the media files on my hard disk so that’s good.

How should I proceed with the migration? what are some do’s and don’ts I should keep in mind?

Have a look at:

Also search the forum for additional tips.

Thank you. I did as instructed in the guide, but when I am importing to my Wordpress localhost through the XML, I get thousands of 'Failed to import media" errors and not a single post got imported.

Then try:

If you have trouble using this plugin, you can export your site for Jekyll and use Hugo’s built in Jekyll converter listed above.

I did it @alexandros’s way. It worked ok for me but it has not been a completely automatic process. I was developing the theme at the same time so that may have slowed things quite a lot but I had to invest 5-20 minutes per post to correct errors and layout issues.

Some posts just did not come out great at all and I had to write scripts to translate the output into something hugo could work with (large image galleries into shortcode based markdown)

Good luck!

Then try:

If you have trouble using this plugin, you can export your site for Jekyll 3 and use Hugo’s built in Jekyll converter listed above.

This also gave me a ton of errors and a faulty import. I got a page full of errors too. Edit: sorry i meant page full of errors for localhost MYSQL transferr. The jekyll exporter you linked just wont load up. It takes entire CPU usage and my site goes offline before the export to jekyll page loads

In case you have the same experience like me

you can check C:\Users\%USERNEAME%\AppData\Local\Temp/wp-hugo-xxxxxxx you will find wp hugo folder in there complete with your exported content

@mrwonka, @alexandros is there no way to export to Hugo from the live wordpress site itself? The jekyll exporter over-exceeds my hosts CPU usage and kills the site. Is there no way to export to hugo from live site itself or just from the XML?

In case you have the same experience like me

you can check C:\Users\%USERNEAME%\AppData\Local\Temp/wp-hugo-xxxxxxx you will find wp hugo folder in there complete with your exported content

Thank you Yudy, but I am struggling to get the site on localhost itself. I am using xampp too. I wonder if i can export from the live site or the xml?

If you’re struggling to run the exporter due to limits being exceeded I would suggest that in your case it’s not possible. You’ll probably want to take a backup of the live site (db and files) and run the exporter on a local Wordpress instance as @Yudy_Ananda suggests.

Yes thats what I am trying to but I can’t get it to run on local wordpress. Struggling to import the SQL database, keep getting an error. Such a frustrating feeling because wordpress is letting me down with simple tasks

Not sure if this doable but if you already have the database in you local computer try to use import the database to xamp via another 3rd party tools maybe like HeidiSQL or have you try to split the content (in case You use XML backup) https://www.hongkiat.com/blog/split-large-xml-for-wordpress/

I thought my “huge” site with 2000 posts was huge…

Regarding the “How do I get the database to my local installation” have a look at the MySQL workbench. They have a migration assistant that is relatively easy to understand (very techy language they use but understanding you can) and can continue failed or partial migrations. Just be careful and DO NOT select anything that wraps your SQL query into transactions. This will probably fail on the wp_posts table. (Transactions are SQL queries that are “collected” and run together in the end. I guess 70.000 posts will kill RAM and swap and all your XAMMP has to offer.

Regarding the timeout issues with the WP to Hugo exporter that you will run into: open the file in the plugins folder that has the plugins-folder-name (probably /wp-content/plugins/wp2hugo/wp2hugo.php or something like that) and add the following line in line 2 (<?php has to come in line 1):

set_time_limit(0);

that will take care with the timeouts. When you run the exporter it might take some hours, my 2000 entries were about 10 minutes on a crappy computer.

The last limitation you might run into is the space this will take up.

If all that fails you could try to use the migration assistant in the Workbench to import 5000 posts, then export them to hugo, then delete them, then import the next 5000 then export then delete then import export delete and so on. Sounds like a lot of work :wink:

Edit: I forgot the link for the Workbench: https://www.mysql.com/products/workbench/