0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

TablePlusを使用したデータベースのバックアップとリストア

Posted at

はじめに

業務でTablePlusを使用していますが、バックアップとリストア機能がうまく使えずちょっと面倒でした。
いまさっき成功したのでメモします。

対象

  • 適当なデータベース
  • Dockerで立てる
version: '3.8'

services:
  postgres:
    image: pgvector/pgvector:pg15
    environment:
      POSTGRES_DB: rag_db
      POSTGRES_USER: rag_user
      POSTGRES_PASSWORD: rag_password
    ports:
      - "5433:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    restart: unless-stopped

volumes:
  postgres_data:

接続

バックアップしたいデータベースに接続する

バックアップする

メニューからバックアップを選択する
image.png

バックアップしたいDBを選択する
add optionから--format=customを選択する。
image.png

バックアップを実行する

リストアする

メニューからリストアを選択する
image.png

リストアしたいDBを選択する
バックアップしたファイルを選択する
image.png

終わり

これでリストアできます。
フォーマット指定を今までずっと間違えていたようです

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?