There are two important sections of The Inventory Management System that need to be backup and/or restore. The system stores images that are uploaded in a directory within the source-code. Backup this directory or the entire application to a folder on your file system.
sudo cp -R /var/www/html/warehouse-inventory-system /home/pi/Downloads/
Backup and Restore Your Database
Export A Database
To Export a database, open up terminal, making sure that you are not logged into MySQL and type,
mysqldump -u [username] -p [database name] > [database name].sql
Backup your Inventory Management System
mysqldump -u'root' -p'password' oswa_inv > /path/to/oswa_inv.sql
The database that selected in the command will now be exported to a file.
Log into mysql command-line interface:
mysql -u'username' -p'password'
If you are having difficulty logging into mysql please see the section below, How to Reset Your Password
WARNING! You are about to permanently delete ALL of your data.
DROP DATABASE oswa_inv;
CREATE DATABASE oswa_inv;
source oswa_inv < /path/to/oswa_inv.sql
How to Reset Your Password
When you first install MySQL, you have to set up your root password. However, should you forget it at any point, you can still recover it.
Step One—Shut Down MySQL
In terminal, stop the MySQL process
Step Two—Access MySQL Safe Mode
In safe mode, you will be able to make changes within the MySQL system with a root password alone, without the need for MySQL root password.
sudo mysqld_safe --skip-grant-tables &
Once safe mode has started up, log into MySQL and when prompted, use your standard root password.
mysql -u root mysql
Step Three—Set Up a New Password
Finally, set up the new MySQL root password by typing the command below. Replace “newpassword” with the password of your choice.
update user set password=PASSWORD("newpassword") where User='root';
Be sure to reload everything:
and you now have a new root password.