Forums / General Questions / Problems changing install directory

Problems changing install directory

Views: 932

Results 1 to 13 of 13
30 Nov 2011, 12:42 PM
#1
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Problems changing install directory

I followed the instructions on https://www.zen-cart.com/tutorials/index.php?article=122 to change my install directory to the root of my site, it seemed to work OK at first, but now I am just getting...

Sorry!
There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.

I still have the original install in place as I didn't want to delete it until I was sure the new install was OK, what is puzzling me is after I login to my new Zen Cart admin directory, the url has /catalog/ and all the links are to /catalog/ (the old install dir.), so it seems I am being re-directed to the old admin area.

NB there is also a setting in my web-host control panel to specify the installation directory, but changing that didn't fix the problem.

Any help please? thanks

30 Nov 2011, 1:11 PM
#2
joejoejoe avatar

joejoejoe

Zen Follower

Join Date:
Oct 2011
Location:
AZ
Posts:
383
Plugin Contributions:
0

Re: Problems changing install directory

Just a few thoughts based on mistakes I might have made myself but I'm not admitting to it -

Step 4 of that tutorial is critical - if you don't set the permissions to writable first, then you just think you've made the changes but you really didn't. And if you're doing it in the middle of the night, 16 hours in front of the monitor with nothing but stale doritos and a 6-pack of red bull, it's easy to make the same mistake over and over and over....

Are you following the old bookmark to get to the new admin site?
(Try typing in www.yourdomain/yoursecretadmin/login.php)

And the big one - if it worked, but then it doesn't - Did your host take the server down for maintenance without telling you?

30 Nov 2011, 1:29 PM
#3
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

Thanks for the response.

The edits look to have been saved fine...

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

I take it that would be right for the root directory?

I'm defintely logged in to the new install, all the links shown there are fine.

30 Nov 2011, 2:18 PM
#4
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

Seems to be OK now. Should I just go ahead and delete the old installation, is there a way to deactivate it without removing the files, or would that be more of a security risk?

30 Nov 2011, 3:03 PM
#5
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Problems changing install directory

I don't see any reason you can't keep the old install as a test site, but if it's still sharing the same database as the live site, any changes you make will be reflected in both sites. You could create a separate database for the "old" cart (create the db, copy the live db into it and then change the config of the "old" cart to point to the test db).

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

1 Dec 2011, 12:17 PM
#6
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

The cart on my main page is now permanently down.

Sorry!
There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.

...is all I can get at present. Any suggestions please?

I've been working on this for about a year now and yet to see a stable install at the url I want :frusty:

1 Dec 2011, 1:11 PM
#7
joejoejoe avatar

joejoejoe

Zen Follower

Join Date:
Oct 2011
Location:
AZ
Posts:
383
Plugin Contributions:
0

Re: Problems changing install directory

Talk to your host and ask then why the server is constantly going down.

1 Dec 2011, 1:25 PM
#8
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

^ Done.

I am a bit concerned about the way I've set the database users up though and wonder if I have bothced that in some way. I tried to set up rotating database users but maybe didn't get it right.

For both installs I have...

$dbuser[] = 'zncif2yUBqK';
$db_pwd[] = '***';

$dbuser[] = 'user_2';
$db_pwd[] = '***';

$dbuser[] = 'user_3';
$db_pwd[] = '***';

$dbuser[] = 'user_4';
$db_pwd[] = '***';

...in includes/configure.php

define('DB_SERVER_USERNAME', 'zncif2yUBqK');
define('DB_SERVER_PASSWORD', '***');

...in admin/includes/configure.php

The passwords for the extra users I added have some special characters so maybe that is causing problems. I'm pretty sure I created the databases OK though.

1 Dec 2011, 1:49 PM
#9
joejoejoe avatar

joejoejoe

Zen Follower

Join Date:
Oct 2011
Location:
AZ
Posts:
383
Plugin Contributions:
0

Re: Problems changing install directory

I think, and I hope a zen-master jumps in and corrects or verifies, that there are two types of users in play here.

When you created the initial SQL database prior to installing ZC, you gave it a name, and then created a user and gave that user a name/password. I'm assuming that's the name you've got down there under DB_SERVER_USERNAME. Whenever you do something in the ZC that requires playing in the database, ZC goes to that line in the config to get the username/password to log in to the db.

All the other users are just admin users - people who have permission to log into the admin panel and do admin stuff. Those accounts are created from the admin panel - Tools > Admin Settings.

You can create 10 different administrators there, and they can all log in to the admin side and do admin stuff, but whichever one is logged in doesn't matter when it's time to write to the db - at that time ZC reads the config file, and logs in to the db as DB_SERVER_USERNAME.

So it doesn't matter how many admins you have, it shouldn't affect use. I still think it looks like your host server is unreliable. When it is down, have you tried seeing your storefront? Look at your webmaster account in Google/Bing and see if you're getting not-found errors of "unreachable". The settings in ZC are either off, or on. The password wouldn't work correctly one day and wrong the next.

I should add - if when you created your sql database, you also created multiple users, that too wouldn't have any effect on the equation. ZC logs in using the DB_SERVER_USERNAME and it could care less about who else you gave permission to.

1 Dec 2011, 2:01 PM
#10
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

Ah, but...

$dbuser[] = 'user_2';
$db_pwd[] = '***';

$dbuser[] = 'user_3';
$db_pwd[] = '***';

$dbuser[] = 'user_4';
$db_pwd[] = '***';

..was entered manually, it was supposed to be a fix for database lag by creating rotating database users. What puzzles me though is that includes/configure.php is exactly like that for both installs, but it is only the one at the root of my site that is having problems, the other install is absolutely fine!

1 Dec 2011, 2:16 PM
#11
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

OK, we've got a pattern here. It's only working for the first 15 minutes of every hour so I'm pretty sure it's the rotating database users section that is causing the problem. I'm going to try restoring the original version.

1 Dec 2011, 2:30 PM
#12
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

Aha, that seems to have fixed it?

Actually, I want to say, the worst thing for me about Zen Cart is both those configure.php files having the same name! That is really confusing, it is so hard to work out which one you are looking at.

1 Dec 2011, 2:32 PM
#13
double_happiness avatar

double_happiness

New Zenner

Join Date:
Dec 2010
Location:
Scotland
Posts:
39
Plugin Contributions:
0

Re: Problems changing install directory

Steady as she goes... Yeeha! :clap: