Moving from subdomain to main domain
Need help with one of our themes? Ask here.

June

Member Rank
Posts: 37
Joined: Wed Aug 12, 2015 12:48 pm

Moving from subdomain to main domain

linkPost by June » Wed Sep 23, 2015 11:04 pm

Hello
Do you have any steps to move my current wp subdomain to main domain?
currently, the website is developed at http://www.sanguineconsulting.com/newwebsite
now, I'm ready to make it live and will like to move it to http://www.sanguineconsulting.com

I've backup my public folder via cpanel
I've backup my wordpress database via database plugin and downloaded it to my local pc

so now, how do I move up the new website to main domain without messing up the theme design and layout and all other images, database etc.

Thank you once again.
User avatar
Asmi Khalil

Site Admin Rank
Posts: 779
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Moving from subdomain to main domain

linkPost by admin » Sun Sep 27, 2015 10:06 pm

Hi,
Sorry for the delayed response. The mailing server was misconfigured so I didn't receive a notification about your new post.
I need to know whether your website files are located in your public HTML folder or in a Sub-folder within it?
Also, make sure you backup your WordPress using the WordPress Importer plugin ( Tools => Export ) because sometimes it's easier and better to restore WP using the WP importer.
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943
June

Member Rank
Posts: 37
Joined: Wed Aug 12, 2015 12:48 pm

Re: Moving from subdomain to main domain

linkPost by June » Mon Sep 28, 2015 9:23 pm

my main domain is in public folder
my new website is in public folder/newwebsite.
User avatar
Asmi Khalil

Site Admin Rank
Posts: 779
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Moving from subdomain to main domain

linkPost by admin » Tue Sep 29, 2015 10:25 pm

First go to your WordPress dashboard Settings => General and remove /newwebsite from your WordPress Address (URL) & Site Address (URL) then Cut & paste everything from /public_html/newwebsite/ to /public_html/.

Now visit this URL http://www.sanguineconsulting.com and you should see your website.
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943
June

Member Rank
Posts: 37
Joined: Wed Aug 12, 2015 12:48 pm

Re: Moving from subdomain to main domain

linkPost by June » Wed Sep 30, 2015 11:35 am

cool! that's sound easy. it won't mess up my database right?

I'll do the launch tomorrow.

Thank you very much
User avatar
Asmi Khalil

Site Admin Rank
Posts: 779
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Moving from subdomain to main domain

linkPost by admin » Thu Oct 01, 2015 11:23 am

No, this issue has nothing related to the database. You can use the same files and database to transfer your website to another domain or server but you MUST change your WordPress Address (URL) and Site Address (URL) BEFORE you move your files to another location ( /public_html in your case).
These instructions are quoted from the WP Codex ( Full article https://codex.wordpress.org/Moving_WordPress ):
Moving Directories On Your Existing Server
Moving the WordPress files from one location on your server to another - i.e. changing its URL - requires some special care. If you want to move WordPress to its own folder, but have it run from the root of your domain, please read Giving WordPress Its Own Directory for detailed instructions.

Here are the step-by-step instructions to move your WordPress site to a new location on the same server:
  1. Create the new location using one of these two options:
    • If you will be moving your WordPress core files to a new directory, create the new directory.
    • If you want to move WordPress to your root directory, make sure all index.php, .htaccess, and other files that might be copied over are backed up and/or moved, and that the root directory is ready for the new WordPress files.
  2. Log in to your site.
  3. Go to the Administration > Settings > General panel.
  4. In the box for WordPress Address (URL): change the address to the new location of your main WordPress core files.
  5. In the box for Site Address (URL): change the address to the new location, which should match the WordPress (your public site) address.
  6. Click Save Changes.
  7. (Do not try to open/view your site now!)
  8. Move your WordPress core files to the new location. This includes the files found within the original directory, such as http://example.com/wordpress, and all the sub-directories, to the new location.
  9. Now, try to open your site by going to yourdomain.com/wp-admin. Note, you may need to go to yourdomain.com/wp-login.php
  10. If you are using Permalinks, go to the Administration > Settings > Permalinks panel and update your Permalink structure to your .htaccess file, which should be in the same directory as the main index.php file.
  11. Existing image/media links uploaded media will refer to the old folder and must be updated with the new location. You can do this with the Better Search Replace or Velvet Blues Update URLs plugins, WP-CLI's search-replace if your hosting provider (or you) have installed WP-CLI, or manually in your SQL database.
  12. In some cases your permissions may have changed, depending on your ISP. Watch for any files with "0000" permissions and change them back to "0644".
  13. If your theme supports menus, links to your home page may still have the old subdirectory embedded in them. Go to Appearance::Menus and update them.
  14. Sometimes you would need to restart your server, otherwise your server may give out an error. (happens in MAMP software (Mac)).
It is important that you set the URI locations BEFORE you move the files.
Hope I helped you :D
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943
June

Member Rank
Posts: 37
Joined: Wed Aug 12, 2015 12:48 pm

Re: Moving from subdomain to main domain

linkPost by June » Fri Oct 02, 2015 3:17 pm

thanks. I have successful launch my website. yippee!!

now I gotta do some redirection which is giving me big problem with the 'regular expression'.
User avatar
Asmi Khalil

Site Admin Rank
Posts: 779
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Moving from subdomain to main domain

linkPost by admin » Fri Oct 02, 2015 3:21 pm

Thats great :)
Glad i helped you! have more questions? feel free to ask!
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943
June

Member Rank
Posts: 37
Joined: Wed Aug 12, 2015 12:48 pm

Re: Moving from subdomain to main domain

linkPost by June » Fri Oct 02, 2015 9:10 pm

I have installed redirection plugin on wordpress.

I have redirected some pages successfully, but just some other pages, couldn't work.

for e.g., for successful pages:
Target: http://www.sanguineconsulting.com/Workshops.html
Destination: http://www.sanguineconsulting.com/workshops

Target: http://www.sanguineconsulting.com/careers.html
Destination: http://www.sanguineconsulting.com/careers

The above worked!

But these don't
Target: http://www.sanguineconsulting.com/Works ... bc123.html
Destination: http://www.sanguineconsulting.com/workshops

I wanted to redirect all files in /WorkshopsNew/ to my new website at /workshops
it just doesn't get redirected.

another example is
Target: http://www.sanguineconsulting.com/Works ... bc123.html
or /Workshops/2014/abc123.html

Destination: /workshops

I wanted to have all files in /Workshops/ to be redirected to the new /workshops
/Workshops in the old website has /2015/ /2014/ 2013 2012 etc

I have tried
/WorkshopsNew/(.*)
/workshops/$1
cannot work.
User avatar
Asmi Khalil

Site Admin Rank
Posts: 779
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Moving from subdomain to main domain

linkPost by admin » Fri Oct 02, 2015 10:10 pm

Which web server are you using? Apache or Nginx? If you are using a shared hosting plan than I am 100% sure your web server is Apache!
It's always better to manage redirection directly from the web server by adding redirection rules to your .htaccess file (if you are using Apache) or virtual server config file (if you are using Nginx). Some people even use the domain DNS zone to manage redirections.
But most time, people need to make simple redirections like redirecting from WWW domain to Non-WWW domain but in your case, you have too many redirections and I still don't understand why, for example, you need to redirect all files (maybe you mean pages?!) in /WorkshopsNew/ to /workshops?
What do you mean by "the old website"? do you have a separate WP installed on sub-directory /workshops?
I have never used a redirection plugin before but it's never a good idea to relay your business website on a plugin that might get outdated or removed from the WP directory. So as I told you, it's better to use your web server to manage redirections. I think this will not be hard whether you are using Apache or Nginx!
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943

Who is online

Users browsing this forum: No registered users and 1 guest

It is currently Fri Feb 22, 2019 8:37 pm