So i am using cpanel on my website and i have public.html/site.com folder and there was one wordpress installed. I created subdomain test.site.com which root was in publilc.html/test and i have created site there and now i want to transfer it to site.com. I have 2 problems now.

First is that i do not know how to do it because i tried a lot of things and nothing worked.

Second is that while trying, i broke test site and now i can access it but half way. By that i mean i can access wp-admin and login but when i go test.site.com it redirects me to site.com. This happened when i went to test site setting through wp-admin, and changed site and site url to site.com, and then i couldn't even access wp-admin but then i went directly to database and changed it back to test.site.com and as i said now i can access wp-admin but it stills redirect me.

Here are my cpanel subdomains:


Here are domains:


If you need anything else please note me.

1 Answer 1


First of all, go to phpMyAdmin, go to your database for test.site.com and edit siteurl and/or home in wp_options table. That'll fix your test.site.com

Now, to migrate test.site.com to site.com, as you've difficulties doing it manually, I'd suggest a plugin like Duplicator or All-in-One WP Migration to migrate the site. It's way easier that way.

To do the migration manually

1). In phpMyAdmin, your database of test.site.com to another database. Here' how to do it.

2). Replace all URL instances of test.site.com with site.com. Run the following query in your new copied DB

UPDATE wp_options SET option_value = replace(option_value, 'http://test.example.com', 'http://example.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://test.example.com','http://example.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://test.example.com', 'http://example.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://test.example.com','http://example.com');

3). Now, move all files from public_html/test to public_html/site.

4). Lastly, change database details to the new copied database in wp-config.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.