Describe the bug
I deployed the app on a server, populated with licenses and assets/models.
I have made two backups, using GUI and using the php artisan snipeit:backup command. (updated backup performed before the restore, the snipe-it app has also been updated with php update.php all went fine).
I have later installed snipe-it on another machine, as we were migrating servers, and performed the documented steps to restore the backup.
I restored the files manually to the respective folders, then I executed an SQL query to restore the database.
On the database I can see the information has been loaded. For example, I can see the list of manufacturers on the database, I can see 4281 rows under "license_seats", so the database has been loaded.
However, the application is blank. The database information is set properly, I checked and rechecked the .env file a million times.
Both Snipe-IT installations have the same version of installed software.
The files are correct, I have ran the following commands:
The first restore attempt, I used:
php artisan migratephp artisan config:clearAfterwards I ran these:
composer dump-autoloadcomposer clear-compiled - "Command "clear-compiled" is not defined."php artisan config:clearphp artisan view:clearphp artisan cache:clearphp artisan route:clearTo Reproduce
Steps to reproduce the behavior:
Expected behavior
The application should be fully restored
Screenshots
See explanation above
Server (please complete the following information):
Desktop (please complete the following information):
4 hours after posting EDIT
I would like to add that if this aims to be a decent application, no features are better than BACKUP/RESTORE. The app may have the best features in the I.T. world, if keeping data safe and restoring after crash can't be achieved, its as good as nothing.
I am facing a complicated situation, where this app has been running in a company, and now it can't be properly moved to another server.
There is little documentation on backups.
There are no methods (via command line or GUI) to restore properly.
I have a backup of a production environment that can't be restored, for lack of documentation, for lack of support (and answers here), and the web is crawled with people having trouble in restoring from backups.
Although this would be a topic for another day, I need an urgent solution to this issue.
Thank you.
Just another user of Snipe-IT here.
Was your production system and the new system running the same version of Snipe-IT, Apache and PHP?
I haven't had any issues backing up or restoring. While Database backups are great and all, I also take block level backups and thus can restore the entire web server to any hypervisor in my organization. And I only go to database restores in cases of moving off of the guest OS.
Hi @Jarli01 thank you for your feedback.
This app was on an hypervisor the organization ditched for an inferior (VPS) service.
But disregarding that, I have the full VM with the production app in backup. I can restore it to an hypervisor and everything is there.
Now I've configured the VPS accordingly:
I can make infinite backups from the working production environment. I really was trying to follow best-practices / guidelines for the restore.
But that doesn't work and this app lacking such seems like a CRITICAL issue.
So the change is with where Snipe-IT was hosted, what VPS? What Distro is being run there, CentOS, Ubuntu, Debian something custom?
To ask the question, why pay for a hosted VPS (who it appears is causing you issues) when you could pay @snipe directly to host Snipe-IT for only $400 a year?
@Jarli01
The VPS is running the same distro I had on the hypervisor.
Both are CentOS 7 machines. (i stated this on my OP)
Why? Well, bc I got some deals with datacenters and I have a VPS that costs us less than 100/year.
The service is great, reliable and with good specs.
The issue here is with the Snipe-IT application, that aims to be a open-source software for asset management, but you can't make a working backup&restore unless you bend over backwards.
@maverick85
The issue here is with the Snipe-IT application, that aims to be a open-source software for asset management, but you can't make a working backup&restore unless you bend over backwards.
I will have to disagree with you on that, members of the community perform both backup and restore and I personally did a few between servers (Linux to windows) and between Linux distros. The beauty of open source is that we as the community can always chip it to make the product better.
What is it you will like to see in Snipe-IT to have a better backup and restore and to what level are you expecting to see this, do you expect an automated process, clearly define documentation that factors in DB level restore?
Let us work as a community and make Snipe-IT great so share your detail feedback.
@EarlRamirez
You are completely entitled to disagree.
Yet, I have today performed a successful backup & restore.
This backup & restore had nothing to do with Snipe-IT or its functionalities. As @Jarli01 mentioned, I performed a full backup on file system level and a full database backup, manually.
I resorted to NONE of Snipe-IT backup features.
I was then able to successfully restore the functioning application to the new space.
Backups & Restores are older than Snipe-IT. The silver lining here is: Snipe-IT is an application that doesn't have a backup & restore method implemented.
Using the documentation on how to backup & restore provided by Snipe-IT was a mistake.
If I had done it plain like in the old days, I'd never experience this issues. Probably that is why people backup & restore and keep using the app.
Here, it was simply my lack of knowledge on the limitations of this software.
I would assess your statement if I had't follow the documentation thoroughly.
Snipe-IT is an application that doesn't have a backup & restore method implemented.
But Snipe-IT does have this functionality. You're backing up the database and restoring the database only. If you need something more or just want to not deal with database restorations you can use block level backups like I do.
And just restore the entire Virtual Machine to the most current backup.
Block level backups being performed by your hypervisor or whatever 3rd party solution you have to create backups.
Obviously this can't be built into the WebServer.
@Jarli01 c'mon man:
The documentation. It gives you two options: GUI or php artisan snipeit:backup
Supposedly it should backup the key files & database, for restore.
I did such, several times. Several times as in "am I turning into some kinda moron who can't follow some simple instructions?"
No, that is not the problem.
The problem is that both the methods described above DO NOT WORK.
Restoring those files doesn't work, etc etc.
So yeah, it's like whatever man. I got the app working on the new space.
Now I know the application can't be trusted to perform backups so I'll have to implement my methods server-wise. So will be done.
If you people all around the Snipe-IT community just want to insist that the backup tasks as described in documentation work and whatnot, sure people, knock yourselves out.
@maverick85 I'm going off of the information you posted, which was you moved to a VPS, installed Snipe-IT and had issues importing the Database backup.
Is that not accurate?
If everything was identical between your VM and the VPS I can't imagine any reason you would've encountered an issue restoring your database.
Beside maybe your .env file being different, but we haven't even gotten to discussing those kinds of details.
I can imagine a reason. I stated it earlier, several times. I dunno why I'm still replying here but sure.
As I said I've made two backups.
One via GUI, one via CMD.
I restored all the files as indicated in several documents, and as mentioned in other issues and posts.
Restored the files on the backup, the keys, the APP_KEY etc etc.
If actually you're implying the fault is on me not on the application, again, whatever.
I had issues because I wasn't aware of the limitations of the software.
The documentation should say "manually backup and restore using your own methods".
Because, using the GUI or the CMD.
Restoring those files, keys, .env etc: Doesn't work.
I did it several times using the same system. I did it so many times that once I stopped doing the "snipe-it documented way" it worked.
Now, if this is something the community should worry about - providing a functioning backup & restore - or not...
Have a good weekend.
I have enabled debug mode - DEBUG MODE FOR WHAT? SFTP TRANSFERING FILES, FOR MANUAL SQL RESTORE, OR FOR COMMAND-LINE COMMANDS?
It's literally the first thing we ask for in the Getting Help documentation. We need to know what "doesn't work" means before we can help you.
Supposedly it should backup the key files & database, for restore.
...
The problem is that both the methods described above DO NOT WORK.
They absolutely do. What did you see in your backup file in Admin Settings > Backups when you downloaded the backup? (A screenshot would be most helpful.)
The problem is that both the methods described above DO NOT WORK.
Again, they absolutely do. We literally perform this action hundreds of times a month for customers who want to go from self-hosted to hosted, and want us to import their data. When you try the backup (either GUI or cli), is there anything in your app logs?
Now I know the application can't be trusted to perform backups so I'll have to implement my methods server-wise. So will be done.
You're certainly entitled to decide the application isn't trustworthy, however our experience hosting thousands of customers and supporting tens of thousands of users is that it does, in fact, work. Its possible that your backup configuration is wrong (if the system can't find mysqldump, for example.)
But based on the clear-compiled "Command "clear-compiled" is not defined." error you saw, my guess would be that you didn't install composer on the new server. __The first bullet point in the Moving Snipe-IT documentation states that you should install Snipe-IT on the target server, which includes installing composer and running composer install to install all of your vendor dependencies.__
The Snipe-IT backup does not store the vendors directory, and it's not expected to. If we did, your backups would be ginormous.
I'm happy to work through this with you to get you handled, but I need you to take the attitude down a few notches. We put a lot of work into this project, and don't need to take abuse from anyone.
I just want to say, I tried the same stuff and also had nothing displayed or changed.
It would be nice to have an one-click or easy restore process.
I'm assuming it's with the composer install, but I use a shared hosted solution. I tried using Softalicous to install it automatically and got nothing too.
I did follow every step, multiple times and cannot get it to change or display anything on the new install. Great program, great GUI, open-sourced, however the lack of an simple one-click restore, or three-step restore (similar to Wordpress - move the package, move the DB, change the config file), this seriously is a 6/10 and would be a 9 or 10/10, its a bummer I cannot use this program. I really loved the UX and the ease.
Most helpful comment
@maverick85
I will have to disagree with you on that, members of the community perform both backup and restore and I personally did a few between servers (Linux to windows) and between Linux distros. The beauty of open source is that we as the community can always chip it to make the product better.
What is it you will like to see in Snipe-IT to have a better backup and restore and to what level are you expecting to see this, do you expect an automated process, clearly define documentation that factors in DB level restore?
Let us work as a community and make Snipe-IT great so share your detail feedback.