Hello everyone,
Following my announcement about migrating to a new web host, “o2switch,” I’m continuing my series of articles on the new version of my site. Today, we’re going to talk about the first step I had to take: migrating WordPress.
As you might have forgotten, I created this tech blog in 2020 using WordPress CMS. So, I’ve been using this CMS for several years now, and I love it. There was no way I was going to switch to another CMS.
However, my WordPress setup was so customized that simply exporting a SQL file and importing it on the new o2switch server wasn’t going to be easy. So, I used the WP CLI command line tool to export the content from my site. I’ll share the command lines with you, which might serve as a bit of a tutorial for those who, like me, want to migrate their site to o2switch.
First, navigate to your WordPress directory, and then run:
wp export --dir=/path/to/directory/
Of course, I ran into a few crashes due to poorly formatted articles (after 4 years, that’s no surprise). So, I fixed the problematic articles, and eventually ended up with XML files containing all my content. This was exactly what I wanted: relatively clean content ready to be imported into a new WordPress.
Next, I went to my o2switch Cpanel interface and simply clicked on their WP Tiger tool to create a fresh, clean WordPress site.

I just had to follow the setup wizard, and voilà, I had a properly configured, secure WordPress on the correct address with the extensions and theme of my choice.

I wasn’t too concerned about the theme, as I planned to use it in “headless” mode, but at least I saved some time and avoided unnecessary hassle.
Once WordPress was set up, WP Tiger offered plenty of tools for log analysis, forcing HTTPS (which I’ll return to), optimizing the database, accessing phpMyAdmin, managing users, selecting themes and extensions, and enhancing security.

It also allowed me to create backups of my WordPress, set up a pre-production environment, analyze site performance, implement caching and optimizations, and handle advanced actions like changing the site address. If you’ve ever done that, you know how tedious it can be, so having a tool to handle it for you is great!
This was already good news for me since I didn’t have to get too involved with the technical WordPress side of things.
Next, I had to re-import all my XML files to populate the new database on the o2switch server:
wp import /path/to/file/*.xml --authors=create
This re-injects all the content into the database and creates the necessary users. Again, I had a few crashes due to some old, poorly formatted articles. So, I edited the XML manually in certain places and eventually imported everything.
Now I had a basic WordPress with all my articles. Cool! Then I installed my favorite WordPress theme, Blocksy, which I find easy to use and very lightweight.

Over the next few weeks in July, I played around with optimizing my database. In my database, I had poorly formatted HTML articles, articles without tags, and articles without images, etc.
Most importantly, I reworked all the categories. So, I had to automatically re-categorize everything. For that, I turned to my AI assistant.

Since I’m not a developer, I used Claude from Anthropic and ChatGPT from OpenAI (to a lesser extent) to develop dozens of very specific plugins to fix all these issues.
Here’s part of the list of plugins I developed to clean up my WordPress:
- Link Space Detector: Lists all articles with links containing spaces in the href attribute.
- Short Content Detector: Lists all articles with fewer characters than the defined threshold.
- Missing Featured Image Detector: Lists all articles with a featured image where the image file no longer exists on the server.
- Auto-Tagger: Automatically analyzes articles and suggests appropriate tags using the ChatGPT API.
- Empty Paragraph Cleaner: Automatically removes empty paragraphs from WordPress articles.
- Video URL Converter: Converts relative video URLs to absolute URLs in post content via an admin interface.
- Emoji Slug Detector: Lists all articles with slugs containing emojis.
- No Featured Image Detector: Lists all articles without a featured image.
- Empty Content Detector: Automatically analyzes articles for empty content and displays the results.
- Editorial Title Changer: Uses AI to generate and change titles for articles in the “Editorial by Korben” category.
- Encoding Fixer: Automatically corrects encoding issues in WordPress articles.
- Broken Image Detector: Lists all articles with inaccessible featured images or images within the content.
- Broken Image Fixer: Automatically repairs broken image links by downloading and re-uploading them.
- Gutenberg Activator: Fixes embedded YouTube blocks in articles containing them.
- Specific Image Detector: Analyzes articles from an external site to find specific images in webp format and associates them with WordPress articles.
- Featured Image Updater: Detects articles whose first item is a 650×200 pixel image (with a 2-pixel tolerance) and sets it as the featured image.
- WebP Featured Image Analyzer: Analyzes all featured images and lists those not in WebP format.
- Auto-Categorizer: Automatically analyzes articles and suggests appropriate categories using the ChatGPT API.
- “How-To” Article Finder: Lists all blog articles whose titles begin with “How” or “how.”
- Closing Tag Cleaner: Cleans up unwanted closing tags at the start of articles.
With all these little plugins, I was able to detect issues, automatically re-categorize all my articles (over 1000), fix broken HTML structures, and generate around 150 images with DALL-E 3 (which I find a bit ugly, but who cares) for articles that lacked illustrations.

When I say I’m not a developer, I mean it’s not my job or passion—it quickly becomes an obsession that keeps me up at night. But I do enjoy creating things, and I understand my code. So, using AI is the perfect way for me to realize all my coding dreams, independently and quickly.
Of course, not everything is smooth sailing. Sometimes AI doesn’t understand everything or creates side effects that mess things up later. So, it still requires brainpower to guide it, avoid blindly accepting everything, and conduct lots of testing.
But I managed to pull it off. I accomplished this entire migration with AI’s help.
Then, still in Cpanel, I generated an SSL certificate for HTTPS via Let’s Encrypt, which was very simple. And since the Really Simple Security WordPress plugin is pre-installable, setting up the certificate was fast and hassle-free.
So that’s what I went through to get a nice, clean WordPress back office, with well-illustrated and categorized articles, even though I still have some work to do on a few older articles.