Well, all of that depends on your specific setup. Say you have your app, filesystem and database on the same hardware instance without any backups and dumps, then I guess you’ll have a hard time.
If your dB is decoupled from your app instance, for example by using a PaaS solution like AWS RDS then your data obviously won’t be lost as the dB is decouple from the instance your app is running on.
If you are planning to „destroy“ your current server then
- dump your DB
- backup your filesystem
- launch a new instance
- install app
- source new DB from your dump
- import your files from the backup of your filesystem
- test if your app is running fine
- switch DNS to point to your new server
- if everything’s going fine, you probably can „destroy“ your old server