Change the database extension for identify which is factory when file format is not json

Change the database extension from .backup.json to .json.backup and .factory.json to .json.factory for easy to identify which file is the factory one.