Forums / General Questions / Copying over a website...

Copying over a website...

Views: 962

Results 1 to 15 of 15
1 Mar 2016, 6:36 PM
#1
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Copying over a website...

Hi,
I have a fully working site which I am copying over to another webdomain so that I can just easily edit it without doing a full install then having to copy the other files bit by bit anyway which would take ages.

Will this work?

If so, do any of the files have my admin name in the code that will need to be changed to my new admin name in order for it to all work. If so and it is just a few files, do you know whaich ones i need to go into or is it just the admin folder name?

Thank you
A

1 Mar 2016, 6:49 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Copying over a website...

If your current site has been built and modified using ZC best practices, then really only information in two files will need to be modified: includes/configure.php and admin/includes/configure.php for the software to work, then when backing up and restoring the database, there are things in the configuration menu within the admin to modify. My store, email, etc. Then perhaps information in the payment modules area (paypal?).

But there is a FAQ about moving to a different server, which ideally is about keeping everything. The same about the contents of the store, just somewhere else...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Mar 2016, 6:54 PM
#3
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Cheers, will give that a try.

Thanks
A

1 Mar 2016, 7:26 PM
#4
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Hi,
Just realised, dont I have to change anyhting that says home/(host login name)/public_html/...?
I went into includes/configure and I could not find any sign of my admin name in there to change.

Have i missed something cos i am starting to think this might not be as easy as I thought it might be

Would it work if I installed zencart and then tried copy everyhting accross except these two files you mentioned?

Sorry I have absolutely no idea what to do. Just spent 2 hour on chat with my web host who basically just mearly completely messed all my files um which I have had to spend all evening putting right.

Thanks
A

1 Mar 2016, 8:51 PM
#5
patclay avatar

patclay

New Zenner

Join Date:
Dec 2008
Location:
New Zealand
Posts:
88
Plugin Contributions:
1

Re: Copying over a website...

Do you have a test server you can copy it to to test? This can be as simple as installing apache, php & mysql on your computer, it doesn't have to be powerful (I had it on my netbook for a long time).

It removes a lot of the pressure about buggering things up. Oh, and do a backup first!

But no, you should be able to copy everything from the old domain to the new one, change the two configure.php files, copy the database and you are done. In theory at least.

The configure.php files give the location of your store on the server - '/home/user/public_html' or whatever.

It might be worth testing that https://www.yourdomain.com' is working first - just put a simple index.html page to test. If it displays as expected, go ahead with zc.

Your admin name is stores in the database, once zc is installed, you can update it through the admin panel.

1 Mar 2016, 9:01 PM
#6
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Ah ok cool,
Just need to check a couple of things with you then...

  • When you name your admin (the name you give so that you can log in to your admin ...mywebsite.co.uk/myadmin) am I creating this when I am changing the names in the config files. WHat i mean is that as i have not pre installed zencart to then make my own admin name and link, is this what is created then when i change the config files?
  • In the 2 config files i cant find my admin name, on either, do you know waht line of text they are in as I have looked and searched and cannot find them.
  • "Your admin name is stores in the database, once zc is installed, you can update it through the admin panel."
    I did not pre install zencart as from what I understood, it was fine to just copy accross, change files and it should be ok.

My web host, when adding a new domain to my account puts my original site under public html, then there is a folder in there that relates to my new site which is where I am putting all my files.
This is what they have told me to do and still that doesnt make sense to me. If you ask me, the whole thing sounds like a giant mess!

Thanks
A

1 Mar 2016, 9:03 PM
#7
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Sorry, one more thing...

So in one of the config files it says...
define('HTTP_SERVER', 'http://mysite.co.uk');
define('HTTPS_SERVER', 'https://mysite.co.uk');
define('HTTP_CATALOG_SERVER', 'http://mysite.co.uk');
define('HTTPS_CATALOG_SERVER', 'https://mysite.co.uk

Do these links need changing to my new sites name also? Or shal I leave them?

I have just tried to go to the admin which would be www.mysite2/adminname2, the link changes to mysite1/admin name1. coming up with adminname1 is understandable as I have not changed it yet but the site changes to mysite1 so I should also be changing where it needs to be done to www.mysite2 ?

Thanks
A

1 Mar 2016, 9:15 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Copying over a website...

If your ZC was installed/upgraded to 1.5.1 or higher, your admin directory is not/should not exist in the admin/includes/configure.php file... It is "auto-sensing". The issue comes with knowing your main site's direct folder path to populate: DIR_FS_ related constants.

As to your HTTP_SERVER related entries, that all depends on how you want to present your store. If it has a new domain name available, then yes you want to change those entries to match your new domain name. Otherwise if your new "store" will always be referenced from your existing domain name, then things are a little different.

As far as the admin folder name itself, don't make it admin and now I would say not to make it anything you have publicly posted. In fact, should make it as convoluted as you would a strong password.

The other thing not fully discussed is the database. If you copy over the configure.php files as is and don't change the database reference information, any changes. You make before creating a new database will reflect in both stores... Just be careful.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Mar 2016, 9:19 PM
#9
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Hi,
I have not pre installed zencart.
Is it just going to be easier but more time consuming to just install zencart and try to either move things accross or manually do as much as I can and just go from there?

I think I might be being too adventurous moving it accross and changing all the important stuff. Sorry, not very technical so it is a bit of a struggle to know fully what i am doing.

Thanks
A

1 Mar 2016, 9:46 PM
#10
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Copying over a website...

Not sure what you mean by not having ZC pre-installed as it appears from the discussion that you have it installed in one place and want to duplicate to another... But no matter.

Yes, the easiest would be: goto the main page of this website (https://www.zen-cart.com), download a vanilla copy of the ZC version you want to duplicate (not discussed yet), upload the contents of the zip file to your new directory. Go into phpmyadmin or similar database utility and create a new database with a user and password, take note of all of those things. Look in. Your old store's include/configure.php for DB_PREFIX, take note of the contents. Then through the new ZC site, access zc_admin install to that new database do not add the demo product using the contents of DB_PREFIX for your new database's prefix. If it was '' then don't enter anything for the database prefix while installing.

Then copy all of your files from your old site to your new site except for includes/configure.php, admin/includes/configure.php and any files in includes/local and admin/includes/local. Do not copy over the .htaccess file that may exist in your original store's root directory.

Backup your old sites database, drop the tables in your new database and import your old database to your new database.

There are FAQs to cover just about every step of this...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Mar 2016, 12:47 AM
#11
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Ok..
So I am starting again and I got as far as install and it is having issues with mysql database. Created it and it doesnt like it ...
Database does not exist
Access denied for user 'craftja1_gifts'@'localhost' to database 'craftja1_gifts'

have tried new and old databases.

Have i missed something?

Thanks
A

2 Mar 2016, 3:54 PM
#12
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

Re: Copying over a website...

Hi,
All sorted and installed so gonna work on copying accross etc.

Sorry if it got a bit confusing back there, I had several chats with my web host yesterday and they completely mixed everything up for me.

Thank you to everyone who tried to help me!

Thanks
A

2 Mar 2016, 6:33 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Copying over a website...

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Mar 2016, 7:45 PM
#14
patclay avatar

patclay

New Zenner

Join Date:
Dec 2008
Location:
New Zealand
Posts:
88
Plugin Contributions:
1

Re: Copying over a website...

rainbow_pixie_star:

Ok..
So I am starting again and I got as far as install and it is having issues with mysql database. Created it and it doesnt like it ...
Database does not exist
Access denied for user 'craftja1_gifts'@'localhost' to database 'craftja1_gifts'

Not sure if you got this fixed, but it is worth remembering/knowing that you can can log into mysql via the command line. This can be useful to troubleshoot exactly what is going wrong - user, password, database.

7 Mar 2016, 6:46 PM
#15
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Copying over a website...

I clone my sites often, to open up new, complementary webshops. All are on different domains, but are functionally just copies of each other. I've got the process down to less than 8 minutes now... (largely by using the help listed in Dr Byte's post above).

20 years a Zencart User