• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Faking a domain name in Plesk while site is in DEV mode

seqoi

Regular Pleskian
Ok i have a bit of a problem and can't find inspiration on how to solve it.

Let me describe situation.

Recently i was hired by a company to migrate and optimize their content to new server. They use wordpress. Usually in such situation i would simply migrate existing content to some of my servers under my company domain and host it on subdomain and test it. Both i and a client could access it etc. When project is done i would simply clone/migrate website to their new server, wiping old content (files and db) and job done.

This time it's different.

This client have internet portal with 15gb of content. 250 000 files in uploads folder. So i could not simply move content to my company subdomain and fiddle with all that because my connection is not lighting fast. I wad under impression that we simply order new VPS and clone wordpress content right there and work from there.

Ma naive idea was to simply access to DEV site when in dev mode by typing server ip address. This works but only for homepage.

When i click Preview in Plesk this is the link i am getting and homepage is working:
http://xx.xx.xxx.xxx/plesk-site-preview/somedomain.com/xxx.xx.x.xxx/ (x is IP address)

But no other links are working and i can not access WP Dashboard.


So i ordered him VPS package (plesk control panel). I migrated all content and homepage and when in Plesk i press Preview - homepage is working but other pages are not working and Wordpress dashboard is not available. I understand that this is because all relation in to website database still point to his original domain www.someexample.com while i am accessing site by IP address. Therefore nothing else works.

My naive idea was to access it via IP work from there and when i am done i simply redirect their old NS names in domain administration to my new NS and server. I use CloudNS premium package.

Question is. Can i somehow fake domain on my DEV website/server instance so i can simply access all content and WP dashboard? Does anyone have any idea? So far my impression is that maybe i could batch rename all old domain links to my DEV server ip and when i am done i batch rename everything to real domain...or anything else to it?
 
The reason why it does not work is that in wp_options table "siteurl" and "homepage" are defining the URL under which WP runs. All links in the website will use this URL, so you cannot simply migrate the files without adapting everything to a new domain name.

Suggestions:

1) targz the content on the source server through SSH console and send it by FTP directly to the new server. This is very fast, because it uses the full bandwith of the servers and does not need download/upload to or from your local computer.
# tar -czf archive.tar.gz mywordpressdirectory
# sftp user@mynewsystem
> put archive.tar.gz
then unpack on new system:
# tar -xf archive.tar.gz

or

2) Use Wordpress plugin "Duplicator". It creates a zip file. Move the zip to the new server (by direct FTP transfer as described in (1)), then use the Duplicator installation routine to unpack it into the new Wordpress. This will allow you to automatically change all domain name referrals to the new domain name. You can then develope on a totally different domain. Once you are done, migrate back to the real name, once again using Duplicator.
 
If I understand it correctly, you have a DEV website where you want to develop it and use the real URL.
If yes, you can just fake the DNS with your hosts file in windows - described here: https://support.rackspace.com/how-to/modify-your-hosts-file/

icator

Yes this is precisely the case. Maybe i wasn't clear i am on Linux-CentOs server (i mean server is run on that OS). I don't see how this is related can you explain a bit better?

Peter yes i use Duplicator all the time. But the crappy thing here is that on current webhosting i can't build 10gb package (php timeout) so i can build it only if i filter out uploads folder. Ivalics got it and now i am trying to find out how can i proceed from that.
 
Is not about the server, is about your local computer to "hack".

ahhh i see but like Peter pointed out this would not work because od database on server is holding relation to links right...

Anyway thanks for help
 
It will be a perfect copy of the original site:

Step 1: Create on DEV server your original domain name.
Step 2. Copy the files from original server to your dev server (you can keep the DB on original server, modify the config or copy the DB as well)
Step 3: not sure, but check if in config there is a config path (dunno wordpress so well)
Step 4: Setup on your local computer in hosts file the domain and new dev IP.
Step 5: Check if you can see the DEV domain. Will work only for you or who do this setup.
 
Back
Top