Creating - importing database issue - mysql

I'v made a huge mistake. It's 5 am for me currently, so i didnt think it trough. I'm complete newbie.
Basically, what i did is this. Bought a vps to learn , added site and all configuration. When i was done, it was the next step to add some posts. Since i do have from my old site a backup of mysql i decided just to import it and have all posts in a minute.
I created a new database with the same name as of my old database and hit import. Problem is it ruined everything. My url points to old url (from old database and asks for old site url).
How i can revert this or fix it whithout deleting a whole vps and starting over.
Thanks

Are you using CPanel ? Are you keeping the previous database backup file somewhere.

Related

MySql databases corrupted after upgrade?

I have been dealing with this issue for a while now. For some reason, when i went to run a Ubuntu upgrade, MySql-server upgrade failed. This was on about 8/10. This had happened before due to a "DATADIR" link (won't go into detail on that just now). I went through hell trying to get the package to upgrade and eventually got the package to upgrade by creating a new MySql database structure (after moving mine somewhere else). Once I did that (with some steps involved) the package upgrade completed.
Then, when I tried to replace the "new" databases with my old onse, it wouldn't start the service. I came to find out that the "Mmysql" (system) database folder was just completely gone.
So, I took the "new" database and overlayed it on my "old" database files. This got me in! Of course, old users, and anything else in the system database, was gone. So I started to rebuild them.
The problem occurred when i tried to go into some old databases. About half of them report that the table does not exist when trying to load them. Mostly, it is all of the tables in particular database, but there are a few databases where some tables "don't exist" and others do.
The thing is that the tables do exist. I believe they are simply corrupt.
So, I'm really trying here, but I can't seem to figure out how to get all of the tables to load. I have a backup from the 13th, presumably after the upgrade failed but before I really started messing with things. I'm going to try to use that, but if anyone knows how/why some tables are corrupted all of a sudden and why others are not and especially if someone knows how to fix this, that would be absolutely wonderful.
Unfortunately, my regular backups haven't been working for months, and the latest backup I currently have access to is 2 years old. Quite a bit has changed in the database since then, but as a last ditch effort, I may try to import that data and use "mysql_upgrade" to restore this, then overlay any new databases I have created since then into the directory structure and see if they import that way.
Thanks for any suggestions you may offer.
--mobrien
I believe this was due to a permissions issue that had some files locked and when I fixed the perm issue, the tables that were accessible were corrupted. I restored the same backup again and this time it worked. The only folder that was missing was the "mysql" folder, and for that I recreated a new one, then patched it in, then created new user permissions for the existing tables. This was working, but then I ran into another issue, so I will open a new questions for that. This has been a nightmare and the moral of the story is: keep better backups and test them!

Big problems with shared SugarCRM database

Here is my situation:
I have two hosting sites with a domain each, each with Sugarcrm infrastructure. I started with one hosting site and started creating a database through Sugar. Then, I started a SECOND hosting site with a new domain, and I believe I have linked the two databases accidentally. If I change a value in the database on one site, it gets reflected on the other.
So, the original domain/hosting site is expiring, and I would like to move the SQL database over to the new site permanently. I have made a backup of the database from the original site and have it on my desktop.
My questions:
1. Can I just drag the SQL file into the new site (I use FileZilla) database location and everything will be OK?
2. I cannot find the location in file manager of the new site where I would drag this database into!? I use goddady, and the newer site uses cpanel.
**Other problem: I have accidentally upgraded the newer sites SugarCrm version, and have created huge problems because the original site is not upgraded, and the sites do not like that very much as the database is shared. There original site is unreachable (it says you cannot use the newer version database with the old Sugar version), and the new site has visible problems but is workable.
As you can tell, I am a totally inexperienced n00b, and am learning as I go. I have spent weeks setting up this database, and would appreciate any help on maintaining its integrity.
Thank you very much!
Tom
I'm assuming you're using MySQL for your database.
Unless your tables are all MyISAM tables, simply copying the database files won't work.
Whenever you want to move a MySQL database it's a good idea to dump the database, move that file over, then recreate the database. Read up on the mysqldump command.
If you're using Oracle or something else, I would think a similar technique would be desirable. Basically dump your database to a backup format that your database server can use to recreate your database. Don't just copy database files around.

Merging two WordPress Post/Comments tables in MySQL phpMyAdmin

I know the "merge tables" question has already been asked in a variety of ways, but I can't seem to find an answer to my specific question.
Here's my deal: I've been designing a WordPress site for an organization for four weeks. When I began designing I took an export of the database and imported into my local development site. In the meantime, this organization has naturally continued to post things and receive/approve comments on their live site. On the local side, I have also created posts, edited pages, changed widgets, etc during development. So now that we're ready to launch the new site, I need to figure out how to merge these last four weeks of database changes from both the live site and the local site without losing anything on either side. How is this done?
If there have been inserts to both databases, then unfortunately there isn't a good way to merge. If your database contains the latest edits for the Post IDs that are shared then you can export them to XML and then import them into the other site.
This is done with the WordPress Importer plugin which can also be installed by visiting /wp-admin/import.php, the export can be done on /wp-admin/export.php. You can also remove any conflicts from the XML file manually, but make sure that you keep it well-formed.

Merge two databases with the missing contents

I have recently migrated one website to a new linux server. But we imported the database of the website was 7days old the actual thing. Now 4 days gone after the migration. So these 4 days database updates which was wriiten to the new server that contains the contents of old server database. We just forget about the 7days database updates from the old server at the time of dns change.
But now our website is having a big issue because they didnt have the missing 7 days database contents. if we imported old database from old server to new server then our latest 4 days database updates on new server will go. Iam in the middle of this.
Can you please suggest a better way to merge these databases into one without any issues or overwritten, so that we can update the same to new server then only the site will run fine. In short we need to merge two databases with the missing contents and site should work fine also. Help me please.
This is going to depend a lot on your data structure (how many auto_increment fields you have, foreign keys, etc.). You will need to dump out everything that was added to the database after the export but prior to the migration, then find a way to import each record.
What is stored in the database?

Why my database disappeared then appeared and now again is disappeared?

I am on cpanel, and working with phpmyadmin.
I create a subdomain, then I create a database, and I changed some of my settings.(2days ago)
But now when I login to cpanel, I see that there is something just like ctrl + z! I mean The only database that was created 5 month ago is now remained and the database which I create it 2 days ago is NOT in my databases list! + I changed the menu settings(put the 'databases' menu on the top, put the 'preferences' menu on the bottom of the cpanel home page and ...) but now there are just like the default cpanel setting.
What's the problem?
I am 75% sure that my cpanel login is NOT hacked.
I've changed the cpanel password but not the phpmyadmin password.
You may only be allotted one database with your webhost. Contact their support.
Your host may have restored a backup. Ask them.
I had something similar occur with my vps account recently. While my databases show up within the mysql database menu list they're no longer available in the backup menu. I tried changing themes and it corrected the problem. The theme I had the problem with is X3.
In my situation I believe the theme must have been broken due to a recent control panel update as I noticed the login page has changed drastically but I'm not sure if that's the same issue you're dealing with.
To clarify, I changed the theme within WHM not cpanel. From X3 to X2. X2 is apparently depreciated so this isn't a long term fix to whatever the underlying issue is; just thought I'd share in case it helps you out.
I found out the problem.
I contact with the host provider, and I found out the problem. He said according to the internet problem in your place and also our previous actions to change the server, your host is sometime, loaded by the new server, and sometime by the previous one! So when I create a database from my computer it connect to the first one, then you browse web or again I check the website from another place, then I connect to the second server, and see that there isn't any database!
I don't have much experience, so I don't know, this answer is true or just for kidding!