Beispiel #1
0
    def rollback_database(self):
        if exists(self.paths.myfs):
            mysql.restore(self.paths.myfs, self.paths.etc.mysql,
                          add_drop_database=True)

        if exists(self.paths.pgfs):
            pgsql.restore(self.paths.pgfs)
Beispiel #2
0
    def database(self):
        if not exists(self.extras.myfs) and not exists(self.extras.pgfs):
            return

        if self.rollback:
            self.rollback.save_database()

        if exists(self.extras.myfs):

            print "\n" + self._title("Restoring MySQL databases")

            try:
                mysql.restore(self.extras.myfs, self.extras.etc.mysql,
                              limits=self.limits.mydb, callback=mysql.cb_print(), simulate=self.simulate)

            except mysql.Error, e:
                print "SKIPPING MYSQL DATABASE RESTORE: " + str(e)
Beispiel #3
0
    def database(self):
        if not exists(self.extras.myfs) and not exists(self.extras.pgfs):
            return

        if self.rollback:
            self.rollback.save_database()

        if exists(self.extras.myfs):

            print fmt_title("DATABASE - unserializing MySQL databases from " +
                            self.extras.myfs)

            try:
                mysql.restore(self.extras.myfs,
                              self.extras.etc.mysql,
                              limits=self.limits.mydb,
                              callback=mysql.cb_print(),
                              simulate=self.simulate)

            except mysql.Error, e:
                print "SKIPPING MYSQL DATABASE RESTORE: " + str(e)