How Upgrade without losing data (with Docker)

I install Metabase by Docker on redhat server, and I want to upgrade to a new version without losing data.
could you give me commands to upgrade, please

This page in the :blue_book: Operations Guide should have you covered:

How to make sure database is out the container?
what is the default path for the database?

See under the heading Copying the application database to find the answer of your first question towards the end of that page I linked to above.

Regarding the default path - where? Do you mean if you have it inside the container …or?

The above page also has a default suggestion for volume mapping the H2 database to a location outside the container.