Skip to content

Demo Database

Akram El Assas edited this page Jun 8, 2025 · 6 revisions

Windows, Linux and macOS

mongorestore --verbose --drop --gzip --host=127.0.0.1 --port=27017 --username=admin --password=$PASSWORD --authenticationDatabase=admin --nsInclude="wexcommerce.*" --archive=wexcommerce.gz

Don't forget to set $PASSWORD.

If you are using MongoDB Atlas, put your MongoDB Atlas URI in --uri= command line argument:

mongorestore --verbose --drop --gzip --uri="mongodb://admin:$PASSWORD@127.0.0.1:27017/bookcars?authSource=admin&appName=wexcommerce" --nsInclude="wexcommerce.*" --nsFrom="wexcommerce.*" --nsTo="wexcommerce.*" --archive=wexcommerce.gz

Copy the content of cdn in /var/www/cdn/wexcommerce on Linux or C:\inetpub\wwwroot\cdn\wexcommerce on Windows.

cdn/wexcommerce/ contains the following folders:

  • cdn/wexcommerce/users: This folder contains users images.
  • cdn/wexcommerce/categories: This folder contains categories images.
  • cdn/wexcommerce/products: This folder contains products images.
  • cdn/wexcommerce/temp: This folder contains temporay files.

Finally, add full access permissions to the user who is running wexCommerce API on /var/www/cdn/wexcommerce on Linux or C:\inetpub\wwwroot\cdn\wexcommerce on Windows.

Admin useradmin@wexcommerce.com
Password: sh0ppingC4rt

Frontend user: jdoe@wexcommerce.com
Password: sh0ppingC4rt

Docker

To restore wexCommerce demo database in Docker containers, proceed as follow:

  1. Make sure that the ports 80, 8001, 4005 and 27017 are not used by any application.

  2. Download and install MongoDB Command Line Database Tools on the host machine.

  3. Add MongoDB Command Line Database Tools folder to Path environment variable in your host machine.

  4. Download wexcommerce-db.zip down to your host machine and unzip it.

  5. Run the compose:

    docker compose up
  6. Go to wexcommerce-db folder and restore the demo database with the following command:

    mongorestore --verbose --drop --gzip --host=127.0.0.1 --port=27017 --username=admin --password=$PASSWORD --authenticationDatabase=admin --nsInclude="wexcommerce.*" --archive=wexcommerce.gz
    

    Replace $PASSWORD with your MongoDB password set in your docker-compose.yml.

  7. Get API Docker container name with the following command:

    docker container ls
    The name should be something like this: src-mi-api-1
  8. Go to wexcommerce-db/cdn folder and copy the content of the folder in API container with the following commands:

docker cp ./cdn/categories src-mi-api-1:/var/www/cdn/wexcommerce
docker cp ./cdn/products src-mi-api-1:/var/www/cdn/wexcommerce

Replace src-mi-api-1 with your API container name.

  1. Go to the backend http://localhost:8001 and login with the following credentials:
    Admin useradmin@wexcommerce.com
    Password: sh0ppingC4rt

  2. Go to the frontend http://localhost and login with the following credentials:
    Frontend user: jdoe@wexcommerce.com
    Password: sh0ppingC4rt

Clone this wiki locally