Subject Re: Restore FBBackupManager not working (non localhost only) - localhost works
Author Ashok122
import java.io.*;
import java.sql.SQLException;
import org.firebirdsql.gds.*;
import org.firebirdsql.gds.ISCConstants;
import org.firebirdsql.gds.ServiceRequestBuffer;
import org.firebirdsql.gds.impl.GDSType;
import org.firebirdsql.gds.impl.GDSFactory;
import org.firebirdsql.management.FBBackupManager;
import org.firebirdsql.management.FBManager; // Needed to create new
BACKUP.

public class TestCase1 {

public static void main(String args[]) {
RestoreBackup("c:\backups\new1.fdb",
"c:\backups\test1.fbk",
"remotecomputer"); // #1
// #1: Test and see what output comes here.

RestoreBackup("c:\backups\new1.fdb",
"remotecomputer:c:\backups\test1.fbk",
"remotecomputer"); // #2
// #2: Test and see what output comes here.

RestoreBackup("c:\backups\new1.fdb",
"localhost:c:\backups\test1.fbk",
"remotecomputer"); // #3
// #3: Test and see what output comes here.

}

public static void RestoreBackup(String sFDBName,
String sFBKName, String sSrvrName) {

sSrcDBPath_and_fileName = sFDBName;
sTgtDBPath_and_fileName = sFBKName;
FBBackupManager fb = new FBBackupManager(GDSType.getType("PURE_JAVA"));
fb.setUser("sysdba");
fb.setPort(3050);
fb.setHost(sSrvrName);
fb.setPassword("masterkey");
fb.setLogger(System.out);
fb.setVerbose(true);
fb.setDatabase(sSrvrName + ":" + sSrcDBPath_and_fileName);
fb.setBackupPath(sTgtDBPath_and_fileName);
fb.setRestoreReplace(true);
try {
fb.restoreDatabase();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
}