The credentials in your database are encrypted, so you would also need to backup the content of your ~/.n8n folder which will include a config file containing the corresponding key. Without this you can still recover the database, but would have to re-create your credentials afterwards.
Depending on how you have configured your n8n instance, this folder also has some other items you might want to keep safe as well, such as logfiles or binary data associated with executions you have stored.
So tl;dr you want to back up both your database and your ~/.n8n folder.