Hi, my ubuntu OS is corrupted, so I have bought a new HDD and reinstalled ubuntu 16.04 and erpNEXT (ubuntu recovery did not work). I can mount my old HDD and can access the old /home and see all my old files on the drive with the dead OS.
I have an old backup of my erpNEXT, but we did a lot of work in the last two weeks so will loose this data if I cannot recover last working version (I know I should back up each day!).
Just wondering is there a safe way to extract my old working erpNEXT from my old drive in /home and import it on my new Ubuntu server with a clean erpNext install?
Any help or suggestions to recover my old files much appreciated.
Your best option would be to get hold of the mariadb data files usually located /var/lib/mysql and restore from those files to a new db. There are many resources online that will guide through the process of doing so.
Once you have restored the old db files you can then restore ERPNext to the latest version of the data you had.
Thanks for the reply. The mysql files are all there. To back the files up I need to know the dB name. I’m not familiar with the mySQL tools. I have found ways to use mysqldump but I don’t know the database name. Can you please point to a mysql reference for this?
Assuming I get the dump from the old dB is the next step just running $bench force restore using the sql dump??
create a new (temporary) database with a different name (ie. not 1bd3e0294da19198).
open the OLD copy of 1bd3e0294da19198, and copy the data to the new temporary DB.
then unmount/unload the old 1bd3e0294da19198, and copy the data from the temporary db to the new 1bd3e0294da19198 one.
I can open the fresh installed erpNext dB and I have created a new dB on the same server, but I cannot find a way to open the old database? If I use the full path to the old dB it returns an error. Can you please advise steps to open the old dB. The command SHOW DATABASES just returns the new databases, it does not locate the old dB (the one I need to recover).
I meant restoring the physical files from the old database.
Follow the steps in this stack exchange
The db name should a more or less identical to the new one you created, since they all differ it will be not be possible for me to determine the db name on your end
I have copied the old mysql dir into the /var/lib. I have not done anything to the files or erpnext. I have just attempted to restart mysql but I get the error message below and it aborts:
/var/lib$ sudo systemctl start mysql
Job for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xe” for details.
When running these the message is:
ec 03 21:41:47 k-erp mysqld[25987]: 171203 21:41:47 [ERROR] Failed to initialize plugins.
Dec 03 21:41:47 k-erp mysqld[25987]: 171203 21:41:47 [ERROR] Aborting
Dec 03 21:41:47 k-erp mysqld[25987]:
Dec 03 21:41:47 k-erp mysqld[25987]: 171203 21:41:47 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 03 21:41:47 kombo-erp mysqld[25987]:
Dec 03 21:42:17 kombo-erp mysql[25629]: …fail!