===== Restoring a PostgreSQL Database ===== {{section>upgrade_map_suite_to_10.0}} Restoring, or creating a database from a PostgreSQL backup file can be accomplished in just a few steps. Begin by opening **PGAdmin** and connecting to the server where you will be performing the restore. You can create a new database by right clicking the server name and using the "New Database..." dialog box. {{worldmapkitsdk:postgresqlnewdatabasedialog.png}} Once you have a database to use, select that database {{worldmapkitsdk:postgresqlselectdatabase.png}} and right click the database name and select "Restore...". Then from that dialog window browse to the .backup file you will be using to restore the database. {{worldmapkitsdk:postgresqlsrestoredialog.png}} Once you've selected your file, click the "Restore" button, and the restore will begin. {{worldmapkitsdk:postgressqlrestorinproc.png}} Keep in mind that depending on the size of the backup file and the computer processing it, the restore could take a long time, maybe even over a day to complete. {{worldmapkitsdk:postgressqlrestorecomplete.png}} ==== Installing and Activating the Required Extensions ==== === PostGis === You may need to install the PostGis extension in order to run spatial queries on the database. In order to do this, open **Stack Builder**, and select PostgreSQL 9.4 (x64)from the drop down and select next. {{worldmapkitsdk:stackbuilder.png}} Expand the the Spatial Extensions option from the list, and select PostGIS 2.1 Bundle for PostgreSQL 9.4 (64 bit) {{worldmapkitsdk:stackbuilderselected.png}} You can then view and/or change the destination they will be downloaded to. {{worldmapkitsdk:stackbuilderreview.png}} You'll be presented with the option to confirm your choices. After doing so, select next. {{:worldmapkitsdk:stackbuidlerconfirm.png}} Once the installation is complete, select close. {{worldmapkitsdk:stackbuildercomplete.png}} === Activating PostGis === == Create Extensions == The final step is creating the extensions in your database. To do this, open a new SQL editor window in your database. Add the code ''Create Extension postgis;'' and execute the statement. {{:worldmapkitsdk:createextnsionsql.png}} Then replace the query with ''Create Extension hstore;'' and execute it as well. Your database should be ready to use at this point.