Page 1 of 1
Why can't I access adminwithout having to reset the password
Posted: Sat Aug 20, 2011 4:29 am
by jasnick
Using CMSMS 1.9.4.2
This is the second time this has happened. I re-do an old site over to CMSMS in a test directory and then transfer it to the proper site. All goes well until I come to access admin. I get a "username or password" incorrect message.
The details ARE correct as I have printed off the installation doc which shows all of these things and anyway, they should already be applied.
I have to go to phpMyAdmin and then I find that the username is "admin", even though I have already set it to something else. So I change it there and then try to login and get the password re-set email sent to me.
I then have the opportunity to change the password so I just type in the one I had already set and I'm good to go.
But why is this happening? Is there some part of the transfer process I have not done? I always replace the config file with the new one.
Thanks
Re: Why can't I access adminwithout having to reset the pass
Posted: Mon Aug 22, 2011 10:12 pm
by Wishbone
I've never seen this before...
What were your exact steps to transfer the site to the new location? I don't see how the username can change during a database transfer.
Re: Why can't I access adminwithout having to reset the pass
Posted: Tue Aug 23, 2011 12:02 am
by jasnick
First I add a new version of CMSMS to my test site and do the site.When setting this up I use "admin" as a username.
When the site is ready, I download the entire file to my computer.
I then go to my main site and set up a new CMSMS in the client site, having first removed the old client site if there is one. For this new version of the CMSMS I use a different username than "admin". I remove the new config file and save it for later.
I then transfer all the files from the downloaded files - this is probably where the error occurs - I must be overwriting something. After this, I transfer the database and then replace the new config file. The site looks OK and works, except I cannot access the admin section using the new username.
Re: Why can't I access adminwithout having to reset the pass
Posted: Tue Aug 23, 2011 12:19 am
by Wishbone
The username is completely in the database.. not in the files... Try transferring the database and immediately look at it in PHPMyAdmin... If you see the wrong account name, then the database was transferred wrong somehow.
Why do you replace the config.php file? How do you generate the new one? I just edit it and change domain names, paths and database info.
Better yet, I completely develop it on the actual server, to eliminate surprises later.. If it's new, I make the default page be "coming soon". If there is an existing site, I install it in a subdirectory and move it later when the site goes live.
Re: Why can't I access adminwithout having to reset the pass
Posted: Tue Aug 23, 2011 12:49 am
by jasnick
Thanks, Wishbone
This is what my host said when I was just starting to use CMSMS:
To transfer a site copy all the file, import the db, and then update the config.php for the new site settings.
To get the benefit of Softaculus upgrading, I would first do an install with Softaculus. Make a backup of the config.php file. Copy over the files. Import the db on top of the Softaculus install. Then replace the config.php file with the one Softaculus made.
So that is what I do.
Thanks, I can see now that it is the DB that is the issue. So by setting it up at the beginning in a sub-directory of the client site, I would avoid having to import the DB.
What is involved in moving it from the sub-directory at the end?
Re: Why can't I access adminwithout having to reset the pass
Posted: Tue Aug 23, 2011 5:04 pm
by Wishbone
Yeah.. I think that the softaculous install is what's messing you up... Say 'admin' has an ID of '1', and it's the primary key, and you change the name... When you do the fresh install, it creates it's own 'admin' with an ID of '1'... When you import your DB on top of that, there is a collision of IDs and the original one probably wins.
The proper way to do it is to clear the cache, copy the files, change the config.php (URLs, paths, database), create the database and import the DB file.
To move it from a sub-directory, all you have to do is change the URLs and the paths. Remove the sub-dir names from these.
Re: Why can't I access adminwithout having to reset the pass
Posted: Wed Aug 24, 2011 12:59 am
by jasnick
Thanks Wishbone - yes, the original install wins out every time!
Installing in the client site in the first place seems the way to go (especially as my test site is on a different server) so will try that in future.
Thanks for the info. I do appreciate it.