Home Forums Tech Web Development MySQL – How to restore selected records? Reply To: MySQL – How to restore selected records?

#2418
DanutaStavishw
Participant

LOAD DATA LOCAL INFILE 'X:\\T\\wp_users.csv'
INTO TABLE wp_users
COLUMNS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';

LOAD DATA LOCAL INFILE 'X:\\T\\wp_usermeta.csv'
INTO TABLE wp_usermeta
COLUMNS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';

Please note that you can even restore key fields, that are set to auto-increase, as long as you to do not attempt to create a duplicate records.  This simple method allowed me to restore a delete user, and later a was able to link her articles back to the original user.  Major PR disaster averted!