Page 1 of 1
Best practice for new installation
Posted: Wed Jun 25, 2025 11:48 pm
by talentive
Hi,
I need to install fresh copy of opencart on a server already running an opencart site. The idea is that this fresh copy will ultimately go live and replace the old site. Let's say that old site is at mydomain.com, would it be okay if I make fresh installation on mydomain.com/new and do all the development there. When ready, I delete all the directories from mydomain.com and shift contents of new folder there and change links in config.php files. My question is, would this work? Without creating any issues of broken links etc.?
What exactly is the best practice for my mentioned scenerio?
Re: Best practice for new installation
Posted: Thu Jun 26, 2025 1:46 am
by OSWorX
talentive wrote: ↑Wed Jun 25, 2025 11:48 pm
Hi,
I need to install fresh copy of opencart on a server already running an opencart site. The idea is that this fresh copy will ultimately go live and replace the old site. Let's say that old site is at mydomain.com, would it be okay if I make fresh installation on mydomain.com/new and do all the development there. When ready, I delete all the directories from mydomain.com and shift contents of new folder there and change links in config.php files. My question is, would this work? Without creating any issues of broken links etc.?
Basically this will work without any problems.
But a second option could be, let the new store inside the subfolder and point via the server config (Plesk, cPanel) to this new folder.
Doing so, let you untouched both sites, but you can still access the old and and the new store.
To be able to call also the old store in future, copy the content if the oldstore also into another subfolder, rewrite both config files (the paths).
Just to have a, accessable copy of the old site if any error might come up in future ..
And if the old store is finally not needed anymore, you can delete then all there ..
Re: Best practice for new installation
Posted: Thu Jun 26, 2025 9:40 am
by talentive
Thanks for your suggestion to be able to keep both sites for a while, I am not a server guy and our setup has cPanel. Can you please point me in the right direction on how to achieve what you said in cPanel? Your help is really appreciated
Re: Best practice for new installation
Posted: Thu Jun 26, 2025 7:27 pm
by OSWorX
I for myself do not use cPanel, have Plesk where such a task is a matter of 2 seconds.
In cPanel it should also be possible, it's only a pointer to the directory .. but maybe one of the user here using cPanle can help you better.
Re: Best practice for new installation
Posted: Wed Jul 09, 2025 1:41 am
by FGSQ
talentive wrote: ↑Wed Jun 25, 2025 11:48 pm
Hi,
I need to install fresh copy of opencart on a server already running an opencart site. The idea is that this fresh copy will ultimately go live and replace the old site. Let's say that old site is at mydomain.com, would it be okay if I make fresh installation on mydomain.com/new and do all the development there. When ready, I delete all the directories from mydomain.com and shift contents of new folder there and change links in config.php files. My question is, would this work? Without creating any issues of broken links etc.?
What exactly is the best practice for my mentioned scenerio?
Yes, your method will work, just follow these steps:
1. Install OpenCart at
mydomain.com/new and develop there.
2. When ready to go live:
a. Backup your site and database.
b. Delete old site files from the root (
mydomain.com).
c. Move everything from [/new] to the root folder.
d. Update BOTH
config.php files (root and admin) to remove /new/ from all paths and URLs.
e. In admin, go to System > Settings > Edit Store, update the store URL.
f. Clear OpenCart caches (modifications, twig, images).
g. Check for any hardcoded /new/ links in themes or extensions.
3. Test the site after moving to catch any issues.
Best practice:
- Always backup first.
- Avoid hardcoding paths in custom code.
- Test everything after moving.
- Use a subdomain (e.g.
dev.mydomain.com) for staging in the future.
Summary:
Your approach is fine if you update the config files and check for any hardcoded /new/ references. Test thoroughly after the move.