My site got hacked and in the end I had to remove the entire WordPress installation and database. My biggest problem now is that I used the Contact Form 7 with a very large number of contacts and it is no longer in my database since I had to make a new one. I did manage to make a backup of the tables containing the contact form data (as SQL and XML). But I don't know if it's possible to restore the data from the backed up tables to the new ones? I don't want to drop the new tables and replace them with the backed up ones (and alter the names of the tables), because I'm not sure if the constraints get the correct name and so on. The database is MySQL via phpMyAdmin
So, essentially I want to move data from one table to a new! Is it possible?
EDIT: Så I imported the old contact form tables, with new names, and it didn't work. BUT, when I reverted to an older version of contact form, it worked. Seems there is a difference in how the versions handle and stores the data. But now I can't upgrade it! As soon as I do, all my contacts disappear. Does anyone know how to fix it, or why it behaves this way?
Contact Form 7 holds all its data in wp_contact_form_7 table (assuming your table prefix is wp_) and doesn't assign forms to pages with a typical database key relationship. Rather, it will place a marker in your page content that gets interpreted and replaced by the plugin and renders the proper form based on the name it finds in your post.
Assuming all your pages & posts have been imported back into your new DB the way it was before, and you've already got CF7 enabled as a plugin, you should be able to import the old contact_form_7 table into your new database from phpMyAdmin without issue.
As always, make a backup of your new database as well in case something goes wrong.
Related
My new vBulletin forum is empty, and I want to encourage new users to visit, like and contribute. But first, I need to make it...not empty. As an admin, I could manually type in a bunch of threads, all from 'admin' - but that won't work. One look at either an empty website or a site filled with admin posts are equally undesirable. So I need to add hundreds of posts from hundreds of users before day one.
I assume that I should do this via the database, which I can access from phpMyAdmin via cPanel. I tried to download (export) the 'user' table with its 74 columns as a CSV table for MS Excel, but when I opened it in Excel, it was not in table form - it was all , and " in a string. If I could only see it laid out nicely in Excel, I could paste hundreds of usernames into the USER table, and and hundreds of articles into the THREAD table. I think. Am I missing something?
I am definitely going to fake it until I make it - there is simply no other way with a new website. The question is whether I have to manually do it from the front end for each user and each new thread (weeks of work), or whether I can paste them all into the database in a couple of hours.
Please help. Thanks.
Just regarding Excel, use the 'Text to Columns' tool on the Data tab to convert the CSV string into columns.
Where are you getting the content from to pre-load your forum though? If you have to make it up anyway, then is there much actual time saving in loading data in via phpMyAdmin in reality?
Assuming you have some content available from somewhere though, then you can export to CSV again from Excel and use a CSV to SQL tool (eg. https://codebeautify.org/csv-to-sql-converter though there are others around also) to generate SQL INSERT statements for uploading via phpMyAdmin or other DB tools. (I don't recall if phpMyAdmin has a SQL file upload mechanism or if you just have to paste the SQL into the browser window... have not used it for a good few years now).
I've migrated a hand crafted website to WordPress website. The previous implementation did have WordPress in a sub directory for a blog. Apparently the admin for the blog was not the owner of the website, I couldn't get the admin username and password from the owner so I couldn't use the duplicator plugin. Due to time constriction I was not able to merge the blog into the new website prior to removing the active blog.
I have all the files and the database (in database.sql form) from the previous version of the website.
I have found the database table diagram at Codex, but I'm most interested in the minimal number of tables necessary to transfer.
What tables from the old database do I need to import into the new database (after changing all the absolute links to the correct addresses)?
I know about the wp_postmeta table and wp_posts table, are there any others I need to import.
It depends on what data you want to preserve.
The main data types and tables are:
Terms (wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms)
Comments (wp_comments, wp_commentmeta)
Users (wp_users, wp_usermeta)
Do you not want to just import the whole .sql file and start from there? That might be easier than trying to piece things together. You could then drop any table than doesn't being with wp_ (or whatever prefix you used).
I just installed MySQL For Excel and have successfully connected to my database.
I have been trying to import various tables by selecting the table name and clicking "Import MySQL Data". All the tables have imported just fine except for ONE table.
I do know that this particular problem table was created from scratch by me awhile back to add a new product to our website. Is there some sort of setting that the table structure has to have within myPHPAdmin to allow it to be imported?
Thanks.
I submitted a bug to mySQL and they actually fixed it!! The full link to the bug submission and their back and forth can be found here: http://bugs.mysql.com/?id=71004&edit=2
I have a large data set in Excel that I want to import into my mysql database for Wordpress.
The current data in Wordpress is made up of two important parts - the users and the posts (with custom data). Each is registered on the site (via the front end) and has to fill in some custom data about their company - that then creates a post and puts all the custom data into the custom fields.
I've used the plugin Advanced Custom Fields to input the custom fields on a post.
How can I upload this list straight into the mysql database? It seems that the current data in Wordpress involves linking the user mysql table with the usermeta table and the posts with the post meta table... but all this seems to be in rows rather than columns, which would take a huge amount of work to reorder.
Isn't there an easier way?
If I have to do it in 3 stages then (1. the users. 2. the posts. 3. the post meta), then I'll have to do it that way. But surely there's a quicker more reliable solution!
There are a few plugins that can do this for you, such as these:
http://wordpress.org/extend/plugins/csv-importer/
http://wordpress.org/extend/plugins/wp-ultimate-csv-importer/
You'll need to set up a blank copy of WordPress, install the plugin, and go from there.
I recently inherited a website and they have a simple back-end area which was created using phpmaker. The back-end displays various MYSQL database tables.
There are two tables which hold registration information related to promotions/contests the company runs online. The client wants to begin archiving the registration data monthly, but still have the data accessible for future export or review.
So, can anyone tell me what the best approach would be to achieve this? I read about partitioning and Maatkit, but I'm not sure which - if either - would be a smart choice.
I would prefer to keep the table names the same because the table name is referenced in several instances within the PHP code running the promo/contest applications. I would also like for everything to be 'automatic' or at least executed at the click of a button; though I realize that might not be completely realistic.
I should note that I do not have the phpmaker project file and have been unable to obtain it.
Any help on this matter would be a great help.
MK-Archiver This is a good way to archive live mysql database tables
What MK- Archiver does is to archive rows from a table to another table and/or a file