woodRock / super-telegram

We are migrating an existing Web Map Service (WMS) to a different server. The existing services uses Apache, Postgres, Postgis (psql extention), and Mapserver. The new version of the server has an updated version of both Mapserver and Postgres installed. Between the major versions of Mapserver some of the syntax from the existing Mapfiles is now deprecated.
0 stars 0 forks source link

Replace localhost references #13

Closed woodRock closed 3 years ago

woodRock commented 3 years ago

Goal

Replace all the occurences of the localhost in Postgres connection strings, with wellmapsrvdev02.

Tasklist

Success Criteria

The host specified in the connection string for each MapFile is wellmapsrvdev02.

woodRock commented 3 years ago

There are no unintended consequences for a global substitution of localhost with wellmapsrvdev02. We can verify this with the following command. This is run in the backups folder after we have performed the replacement using sed.

cat *.bak | grep "localhost" | grep -vi "connection"
woodRock commented 3 years ago

The connection string for each of the MapFiles can be changed using sed. We can provide a backup suffix and directory to the -i flag, to create backups for the files.

sed -i'backups/*.bak' 's/localhost/wellmapsrvdev02/g/' *.map