On 3rd November my old domain zeroinside.in has been expired, then I decided to buy new domain with TLD .id because I think its better to have my origin country domain . After search some provider sites that collaborate with PANDI, I bought it at 180k/years IDR on IDCloudHost.
I thought it was simple migration but it wasn’t. I must update some configuration and do somethings. What somethings? Here it was.
Setup New Domain
The first things I did was managed the nameserver to point the linode name server here
then I deleted IDCloudHost‘s dns manager that manage my domain, so I can use external dns manager that linode has.
On linode, I created new domain to setup new domain with default records, and after that add new A/AAAA Record for subdomain.
After waiting some hours for DNS propagation, finally I can access my new domain at browser.
Add SSL
I used SWAG container for easy setup web server, and it has let’s encrypt that provides free SSL to secure my domain. In SWAG docker-compose.yml I just changed URL environment variable and good to go.
Here some part of swag environment variable
- URL=zeroinside.id
- SUBDOMAINS=wildcard
- VALIDATION=dns
- DNSPLUGIN=linode
Before that I need to add API Linode key to dns plugin in SWAG to proceed SSL certificate with their certs bots.
Issues
Some subdomain had bad gateway response from Nginx that indicates something wrong with the configuration. The problem was the old configuration proxy file still use old domain url and I need to update it to new one 🙂
Also I had some issue with WordPress domain, I need to update it via CLI. I accessed mariadb container and use my wp database.
Here’s some SQL query that I executed
UPDATE
wp_options
SET
option_value = replace(option_value, 'zeroinside.in', 'zeroinside.id')
WHERE
option_name = 'home'
OR
option_name = 'siteurl';
UPDATE
wp_posts
SET
guid = replace(guid, 'zeroinside.in', 'zeroinside.id');
UPDATE
wp_posts
SET
post_content = replace(post_content, 'zeroinside.in', 'zeroinside.id');
UPDATE
wp_postmeta
SET
meta_value = replace(meta_value, 'zeroinside.in', 'zeroinside.id');
Then I reloaded the blog, it was still not changed. After some searched, the home URL and the site URL, it may be set in wp-config.php then I took a look and found some line that I thought it was added before and just updated it to the new one.
define('WP_HOME','https://blog.zeroinside.id');
define('WP_SITEURL','https://blog.zeroinside.id');
A litte bugs came in the home, need to remove. Unfortunately, the header image was disappeared. From the browser network logs, the request get 404 response that indicates the file not found, and it still use old url path. To solve that, I just login to wp-admin and updated the header image in themes customization then viola.
End of Technical Story
That was my way to migrate to new domain from setup new domain until solve some issue. The idea is just point the domain name server to existing cloud provider, do some update, and all good to go. Cheers 🍻
Leave a Reply