- Jun 7, 2000
- 9,099
- 19
- 81
I wrote a registration portal for a company earlier this year... it's powered by PHP & MySQL. Tonight, I became aware that I needed to copy the files and the database exactly as they were, to a new website, for another company. No big deal, right?
I created a tar of the files from the origin website, sent it over to the destination account, and untarred the files.
I created a new database for the new site. We'll call the old database "registration", and the new database "auction". After I created the database, I needed some way to get the data from one database into the other... the easiest way I could think of doing that was to run mysqldump on "registration" to pipe the database into an SQL dump file, and then I ran mysql on "auction", piping the registration.sql dump file back into it, to create an identical database... the only difference should be the database name.
I then modified the files in the "auction" account, so that they reflected the new database name and password.
I check phpMyAdmin, and everything appears sound.
So, I started using the "auction" site, making the customizations that it needs. An hour or so later, I went back to the "registration" site, and realized that the changes I was making on the new site are also happening on the old site... meaning that the new site is still using the old database. After smacking myself in the forehead, I loaded the database connection script, to fix it... thinking that I had just forgotten to set the correct database name & password, or had forgotten to save the changes. Nope! The changes were there, and they were correct. I have a debug script on those sites that echoes back the MySQL connection properties (including the database name, username, and password)... the new site reflected that it was using the new site's database, user, and pass, and the old site reflected that it was using the old site's database, user, and pass. Yet that's not possible, because the changes are happening on both sites at the same time.
I opened all of the files in the new site's folder, and searched them for the username and database name of the old site... they did not exist.
I opened all of the files in the old site's folder, and searched them for the username and database name of the new site... they also did not exist.
I'm rather stumped as to what on earth I did wrong, or what is causing the error. :Q
Any ideas?
I created a tar of the files from the origin website, sent it over to the destination account, and untarred the files.
I created a new database for the new site. We'll call the old database "registration", and the new database "auction". After I created the database, I needed some way to get the data from one database into the other... the easiest way I could think of doing that was to run mysqldump on "registration" to pipe the database into an SQL dump file, and then I ran mysql on "auction", piping the registration.sql dump file back into it, to create an identical database... the only difference should be the database name.
I then modified the files in the "auction" account, so that they reflected the new database name and password.
I check phpMyAdmin, and everything appears sound.
So, I started using the "auction" site, making the customizations that it needs. An hour or so later, I went back to the "registration" site, and realized that the changes I was making on the new site are also happening on the old site... meaning that the new site is still using the old database. After smacking myself in the forehead, I loaded the database connection script, to fix it... thinking that I had just forgotten to set the correct database name & password, or had forgotten to save the changes. Nope! The changes were there, and they were correct. I have a debug script on those sites that echoes back the MySQL connection properties (including the database name, username, and password)... the new site reflected that it was using the new site's database, user, and pass, and the old site reflected that it was using the old site's database, user, and pass. Yet that's not possible, because the changes are happening on both sites at the same time.
I opened all of the files in the new site's folder, and searched them for the username and database name of the old site... they did not exist.
I opened all of the files in the old site's folder, and searched them for the username and database name of the new site... they also did not exist.
I'm rather stumped as to what on earth I did wrong, or what is causing the error. :Q
Any ideas?