Using vagrant & puppet, how to create and restore a database on fresh postgresql-server instance? -


i have fresh provisioned instances of apache , postgres set go. restore dump or mount logical volume data postgres instance. likewise, i'd ensure dump written out or volume unmounted when bring instance down.

can use logical volume way? how should approach?

i see this: how handle data such mysql, web sites sources vagrant?

the other answer had following suggestions. below discuss implications postgresql.

in current version of vagrant (1.0.3), have 2 main options:

  • use shared folders. can put mysql data directory shared folder data comes onto host machine. con of shared folders quite slow compared native vm filesystem in virtualbox, , can run weird permission issues well.
  • setup task (rake, make, etc.) copy mysql data shared folder on demand. then, before decide destroy vm, can run task export data shared folder, can reimport data when bring vm up.

the shared folders approach may work, if need extremely careful file permissions. postgresql tends paranoid this, may have cautious group permissions.

i recommend based on second approach base backup (using pg_basebackup) since copy of database. can archive wal segments directory have can restored on demand near-present conditions.


Comments

Popular posts from this blog

ruby on rails - Is it the correct way to implement belongs_to relation with factory girl? -

geolocation - Windows Phone 8 - Keeping background location tracking active beyond four hours -

Uncaught TypeError: Cannot read property 'parentNode' of null javascript -