IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Administration SQL Server Discussion :

[ PostgreSQL ] Pbm migration base d'un serveur à un autre


Sujet :

Administration SQL Server

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 7
    Points : 7
    Points
    7
    Par défaut [ PostgreSQL ] Pbm migration base d'un serveur à un autre
    Bonjour.

    J'avoue ne pas être au point sous Linux et PostgreSQL mais je ne sais plus comment et vers où orienter mes recherches par rapport à mon pbm.

    Bon, si personne ne comprend mon explication ci-dessous, je tenterai une formulation un peu plus basée sur la prose.

    Merci de m'aider :


    Action à réaliser :
    ___________________

    Sauver la base de données nommée XXXX de type POSTGRESQL (accédée depuis un intranet) se trouvant sur l'ancien serveur Linux et la restaurer sur le nouveau serveur Linux.

    Il existe un utilisateur PosgreSQL nommé postgres et j'ai créé un utilisateur XXXX sur le nouveau serveur tout cela l'avait été fait sur l'ancien. Je suis bête et méchant, donc je m'applique à recréer au mieux le même environnement des deux côtés.

    Donc, pg_dump à faire sur l'ancien serveur, puis pg_restore sur le nouveau. Le fichier tar de sauvegarde est copié d'un serveur à l'autre depuis mon poste Windows via Samba.

    Voici deux procédures qui mènent à un arrêt (FAILURE) durant le pg_restore :


    -------------------------------------------------------
    1 - ACTION REALISEE SOUS L'USER POSTGRES DES DEUX COTES
    -------------------------------------------------------


    Sur l'ancien serveur :
    ______________________


    [root@dhcppc5 etc]# su - postgres
    bash-2.05a$ psql XXXX
    Bienvenu à psql, l'interface interactif de PostgreSQL.

    Tapez: \copyright pour l'information de copyright
    \h pour l'aide-mémoire sur les commandes SQL
    \? pour l'aide-mémoire sur les commandes internes
    \g ou point-virgule pour exécuter une requête
    \q pour quitter

    XXXX=# \l
    Liste des bases de données
    Nom | Propriétaire | Encodage
    -------------+--------------+-----------
    XXXX | postgres | SQL_ASCII
    bug_tracker | postgres | SQL_ASCII
    template0 | postgres | SQL_ASCII
    template1 | postgres | SQL_ASCII
    (4 lignes)

    XXXX=# \q
    bash-2.05a$ pg_dump -Ft XXXX > /tmp/savebase.tar
    bash-2.05a$





    Sur le nouveau serveur :
    ________________________


    [root@dhcppc8 /]# su - postgres
    bash-2.05a$ dropdb XXXX
    DROP DATABASE
    bash-2.05a$ createdb XXXX
    CREATE DATABASE
    bash-2.05a$ psql XXXX
    Bienvenu à psql, l'interface interactif de PostgreSQL.

    Tapez: \copyright pour l'information de copyright
    \h pour l'aide-mémoire sur les commandes SQL
    \? pour l'aide-mémoire sur les commandes internes
    \g ou point-virgule pour exécuter une requête
    \q pour quitter

    XXXX=# \l
    Liste des bases de données
    Nom | Propriétaire | Encodage
    -------------+--------------+-----------
    XXXX | postgres | SQL_ASCII
    bug_tracker | postgres | SQL_ASCII
    template0 | postgres | SQL_ASCII
    template1 | postgres | SQL_ASCII
    (4 lignes)

    XXXX=# \q
    bash-2.05a$ pg_restore -d XXXX /mnt/disk2/XXXX/savebase.tar
    pg_restore: [archiver (db)] could not reconnect to database: FATAL 1: IDENT authentication failed for user "XXXX"



    ----------------------------------------------------------------------------------------------------
    2 - ACTION REALISEE SOUS L'USER POSTGRES DES DEUX COTES PUIS AVEC L'USER XXXX SUR LE NOUVEAU SERVEUR
    ----------------------------------------------------------------------------------------------------


    Sur l'ancien serveur :
    ______________________


    [root@dhcppc5 etc]# su - postgres
    bash-2.05a$ psql XXXX
    Bienvenu à psql, l'interface interactif de PostgreSQL.

    Tapez: \copyright pour l'information de copyright
    \h pour l'aide-mémoire sur les commandes SQL
    \? pour l'aide-mémoire sur les commandes internes
    \g ou point-virgule pour exécuter une requête
    \q pour quitter

    XXXX=# \l
    Liste des bases de données
    Nom | Propriétaire | Encodage
    -------------+--------------+-----------
    XXXX | postgres | SQL_ASCII
    bug_tracker | postgres | SQL_ASCII
    template0 | postgres | SQL_ASCII
    template1 | postgres | SQL_ASCII
    (4 lignes)

    XXXX=# \q
    bash-2.05a$ pg_dump -Ft XXXX > /tmp/savebase.tar
    bash-2.05a$





    Sur le nouveau serveur :
    ________________________

    [root@dhcppc8 /]# su - postgres
    bash-2.05a$ psql XXXX
    psql: FATAL 1: Database "XXXX" does not exist in the system catalog.
    bash-2.05a$ createdb XXXX
    CREATE DATABASE
    bash-2.05a$ psql XXXX
    Bienvenu à psql, l'interface interactif de PostgreSQL.

    Tapez: \copyright pour l'information de copyright
    \h pour l'aide-mémoire sur les commandes SQL
    \? pour l'aide-mémoire sur les commandes internes
    \g ou point-virgule pour exécuter une requête
    \q pour quitter

    XXXX=# \l
    Liste des bases de données
    Nom | Propriétaire | Encodage
    -------------+--------------+-----------
    XXXX | postgres | SQL_ASCII
    bug_tracker | postgres | SQL_ASCII
    template0 | postgres | SQL_ASCII
    template1 | postgres | SQL_ASCII
    (4 lignes)

    XXXX=# \q
    bash-2.05a$ exit
    logout
    [root@dhcppc8 /]# su - XXXX
    [XXXX@dhcppc8 XXXX]$ pg_restore -d XXXX /mnt/disk2/XXXX/savebase.tar
    pg_restore: [archiver] WARNING:
    Data restoration may fail because existing triggers cannot be disabled
    (no superuser user name specified). This is only a problem when
    restoring into a database with already existing triggers.
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'nombreposte_pkey' for table 'nombreposte'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'connexion_pkey' for table 'connexion'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'utilisateur_pkey' for table 'utilisateur'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'typeclient_pkey' for table 'typeclient'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'client_pkey' for table 'client'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'clienttechnique_pkey' for table 'clienttechnique'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'titre_pkey' for table 'titre'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'hierarchie_pkey' for table 'hierarchie'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'interlocuteur_pkey' for table 'interlocuteur'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'actiondocument_pkey' for table 'actiondocument'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'option_pkey' for table 'option'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'produit_pkey' for table 'produit'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'produitoption_pkey' for table 'produitoption'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'sousproduit_pkey' for table 'sousproduit'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'propal_pkey' for table 'propal'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'clientpropal_pkey' for table 'clientpropal'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'proposition_pkey' for table 'proposition'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'service_pkey' for table 'service'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'clientcontrat_pkey' for table 'clientcontrat'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'suiviproduits_pkey' for table 'suiviproduits'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'suivioptions_pkey' for table 'suivioptions'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'bonlivraison_pkey' for table 'bonlivraison'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'livraison_pkey' for table 'livraison'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'rattachement_pkey' for table 'rattachement'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pays_pkey' for table 'pays'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'typeaction_pkey' for table 'typeaction'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'os_pkey' for table 'os'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'protocole_pkey' for table 'protocole'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'effectif_pkey' for table 'effectif'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'ca_pkey' for table 'ca'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'raisonlivraison_pkey' for table 'raisonlivraison'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'echeance_pkey' for table 'echeance'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'concurrent_pkey' for table 'concurrent'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'taxe_pkey' for table 'taxe'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'indice_pkey' for table 'indice'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'action_pkey' for table 'action'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'service2_pkey' for table 'service2'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'activite_pkey' for table 'activite'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'typecontrat_pkey' for table 'typecontrat'
    pg_restore: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'contrat_pkey' for table 'contrat'
    pg_restore: [archiver (db)] could not reconnect to database: FATAL 1: IDENT authentication failed for user "apache"

  2. #2
    Futur Membre du Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 7
    Points : 7
    Points
    7
    Par défaut Re: [ PostgreSQL ] Pbm migration base d'un serveur à un autr
    Personne pour m'aider alors...?

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Octobre 2002
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2002
    Messages : 43
    Points : 35
    Points
    35
    Par défaut
    si mais je ne comprend pas trop ton probléme.

    j'ai néanmoins quelque petites chose a te dire.
    Est-tu sur d'avoir créé correctement ton user XXX?
    Regarde dans ton fichier savebase.tar si postgres a bien sauvegardé ta base ?
    Regarde si tes tables sont créé toutes ou seulement une partie ?
    Regarde dans savebase.tar si tu trouve des lignes qui ressemble à ceci

    \connect - XXX

    regarde bien tu peut en avoir plusieur, car une table est toujours créé par un utilisateur donc plusieurs table = peut-être plusieurs utilisateur.

    si tu n'as toujours pas trouvé

  4. #4
    Futur Membre du Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 7
    Points : 7
    Points
    7
    Par défaut
    Merci.

    Je vais suivre tes conseils dès que possible et ne manquerai pas de te recontacter pour faire évoluer la solution à mon problème, voir même te remercier si ceci me sauve :-)

    A+

Discussions similaires

  1. Probleme Migration Site d'un serveur à un autre
    Par leon1983 dans le forum SharePoint
    Réponses: 2
    Dernier message: 13/08/2008, 16h13
  2. Migration bases d'un serveur vers un autre
    Par MrSaladin dans le forum MS SQL Server
    Réponses: 8
    Dernier message: 28/02/2008, 15h46
  3. Réponses: 7
    Dernier message: 21/02/2008, 12h42
  4. Transférer une base d'un serveur à un autre
    Par Oluha dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 02/09/2005, 10h10
  5. [ PostgreSQL ] Pbm migration base d'un serveur à un autre
    Par TiSteph dans le forum PostgreSQL
    Réponses: 3
    Dernier message: 06/03/2003, 18h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo