[Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-04 Thread Tony Shepherd (FarmMaps NZ) via QGIS-User
Hi All

 

I am sure I am not the first to ponder how to deal with this.  I have loads,
thousands likely, of project files in a series of folders and subfolders.  I
need to move those files and folders to a new location to enable other staff
to use the project files and their associated shp files, geo packages,
rasters etc.

 

Essentially, I am shifting my entire collection of GIS work to a shared
location for others to start using, so moving from a sole operator to a
shared environment.

 

In my old MapInfo days, I would simply do a bulk search and replace over the
workspace files (text-based so this is easy) and change the paths that need
changing and all would be ok.

 

As qgz files are not easily modified through a text editor, are there any
tools out there to enable bulk changing of file paths in those files? 

 

Any other approaches?

 

Cheers

Tony

 


--

Tony Shepherd

  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos

 

Phone - 027 435 6193  | Website -  
shepherdphotos.co.nz

Email - Maps   t...@farmmaps.nz  |  Email - Photos
 t...@shepherdphotos.co.nz

Facebook   TonyShepherdPhotos

 

 



 

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-04 Thread Jorge Gustavo Rocha via QGIS-User

Hi Tony,

You can unzip the qgz file and change the text in the qgs files. qgs are 
text files. Afterwards, you can create the zip again with the qgz 
extension or open the qgs file directly.


I hope it helps,

Jorge

On 04/04/24 19:28, Tony Shepherd (FarmMaps NZ) via QGIS-User wrote:


Hi All

I am sure I am not the first to ponder how to deal with this.  I have 
loads, thousands likely, of project files in a series of folders and 
subfolders.  I need to move those files and folders to a new location 
to enable other staff to use the project files and their associated 
shp files, geo packages, rasters etc.


Essentially, I am shifting my entire collection of GIS work to a 
shared location for others to start using, so moving from a sole 
operator to a shared environment.


In my old MapInfo days, I would simply do a bulk search and replace 
over the workspace files (text-based so this is easy) and change the 
paths that need changing and all would be ok.


As qgz files are not easily modified through a text editor, are there 
any tools out there to enable bulk changing of file paths in those files?


Any other approaches?

Cheers

Tony

--

*Tony Shepherd*

/GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos/

*/Phone/**–* 027 435 6193  | */Website/ – *shepherdphotos.co.nz 



*/Email/**– Maps*t...@farmmaps.nz   | 
*/Email/ – Photos* t...@shepherdphotos.co.nz 



*/Facebook/*TonyShepherdPhotos 



FM_logo1_small (Custom)


___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-04 Thread oisin.kelly.wild--- via QGIS-User
If you use Python it should be fairly simple to enumerate all layers, test to 
see if they're file based and then use pattern matching to alter the file paths


⁣Oisin
07570 977449

Get BlueMail for Android ​

On 4 Apr 2024, 19:28, at 19:28, "Tony Shepherd (FarmMaps NZ) via QGIS-User" 
 wrote:
>Hi All
>
>
>
>I am sure I am not the first to ponder how to deal with this.  I have
>loads,
>thousands likely, of project files in a series of folders and
>subfolders.  I
>need to move those files and folders to a new location to enable other
>staff
>to use the project files and their associated shp files, geo packages,
>rasters etc.
>
>
>
>Essentially, I am shifting my entire collection of GIS work to a shared
>location for others to start using, so moving from a sole operator to a
>shared environment.
>
>
>
>In my old MapInfo days, I would simply do a bulk search and replace
>over the
>workspace files (text-based so this is easy) and change the paths that
>need
>changing and all would be ok.
>
>
>
>As qgz files are not easily modified through a text editor, are there
>any
>tools out there to enable bulk changing of file paths in those files?
>
>
>
>Any other approaches?
>
>
>
>Cheers
>
>Tony
>
>
>
>
>--
>
>Tony Shepherd
>
>  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos
>
>
>
>Phone - 027 435 6193  | Website -  
>shepherdphotos.co.nz
>
>Email - Maps   t...@farmmaps.nz  |  Email -
>Photos
> t...@shepherdphotos.co.nz
>
>Facebook  
>TonyShepherdPhotos
>
>
>
>
>
>
>
>
>
>
>
>
>
>___
>QGIS-User mailing list
>QGIS-User@lists.osgeo.org
>List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-04 Thread Tony Shepherd (FarmMaps NZ) via QGIS-User
Thanks Jorge

 

Yes, I toyed with that, but somewhat painful with thousands to process.

 

Has anybody scripted or coded something for this?

 

Cheers

 

From: QGIS-User  On Behalf Of Jorge Gustavo 
Rocha via QGIS-User
Sent: Friday, April 5, 2024 7:53 AM
To: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Moving many project files - bulk updating paths to 
tables?

 

Hi Tony,

You can unzip the qgz file and change the text in the qgs files. qgs are text 
files. Afterwards, you can create the zip again with the qgz extension or open 
the qgs file directly.

I hope it helps,

Jorge

On 04/04/24 19:28, Tony Shepherd (FarmMaps NZ) via QGIS-User wrote:

Hi All

 

I am sure I am not the first to ponder how to deal with this.  I have loads, 
thousands likely, of project files in a series of folders and subfolders.  I 
need to move those files and folders to a new location to enable other staff to 
use the project files and their associated shp files, geo packages, rasters etc.

 

Essentially, I am shifting my entire collection of GIS work to a shared 
location for others to start using, so moving from a sole operator to a shared 
environment.

 

In my old MapInfo days, I would simply do a bulk search and replace over the 
workspace files (text-based so this is easy) and change the paths that need 
changing and all would be ok.

 

As qgz files are not easily modified through a text editor, are there any tools 
out there to enable bulk changing of file paths in those files? 

 

Any other approaches?

 

Cheers

Tony

 

--

Tony Shepherd

  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos

 

Phone – 027 435 6193  | Website –  <http://shepherdphotos.co.nz/> 
shepherdphotos.co.nz

Email – Maps  <mailto:t...@farmmaps.nz> t...@farmmaps.nz  |  Email – Photos   
<mailto:t...@shepherdphotos.co.nz> t...@shepherdphotos.co.nz

Facebook  <https://www.facebook.com/TonyShepherdPhotos> TonyShepherdPhotos

 

 



 





___
QGIS-User mailing list
QGIS-User@lists.osgeo.org <mailto:QGIS-User@lists.osgeo.org> 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-05 Thread Gordon Wakelin-King via QGIS-User
There is a project packager plugin that works pretty well. It may not be 
exactly what you need but maybe the author could be approached for tips on the 
process.

Get Outlook for Android<https://aka.ms/AAb9ysg>

From: QGIS-User  on behalf of Tony Shepherd 
(FarmMaps NZ) via QGIS-User 
Sent: Friday, April 5, 2024 6:06:48 AM
To: 'Jorge Gustavo Rocha' ; qgis-user@lists.osgeo.org 

Subject: Re: [Qgis-user] Moving many project files - bulk updating paths to 
tables?


Thanks Jorge



Yes, I toyed with that, but somewhat painful with thousands to process.



Has anybody scripted or coded something for this?



Cheers



From: QGIS-User  On Behalf Of Jorge Gustavo 
Rocha via QGIS-User
Sent: Friday, April 5, 2024 7:53 AM
To: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Moving many project files - bulk updating paths to 
tables?



Hi Tony,

You can unzip the qgz file and change the text in the qgs files. qgs are text 
files. Afterwards, you can create the zip again with the qgz extension or open 
the qgs file directly.

I hope it helps,

Jorge

On 04/04/24 19:28, Tony Shepherd (FarmMaps NZ) via QGIS-User wrote:

Hi All



I am sure I am not the first to ponder how to deal with this.  I have loads, 
thousands likely, of project files in a series of folders and subfolders.  I 
need to move those files and folders to a new location to enable other staff to 
use the project files and their associated shp files, geo packages, rasters etc.



Essentially, I am shifting my entire collection of GIS work to a shared 
location for others to start using, so moving from a sole operator to a shared 
environment.



In my old MapInfo days, I would simply do a bulk search and replace over the 
workspace files (text-based so this is easy) and change the paths that need 
changing and all would be ok.



As qgz files are not easily modified through a text editor, are there any tools 
out there to enable bulk changing of file paths in those files?



Any other approaches?



Cheers

Tony



--

Tony Shepherd

  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos



Phone – 027 435 6193  | Website – 
shepherdphotos.co.nz<http://shepherdphotos.co.nz/>

Email – Maps t...@farmmaps.nz<mailto:t...@farmmaps.nz>  |  Email – Photos  
t...@shepherdphotos.co.nz<mailto:t...@shepherdphotos.co.nz>

Facebook TonyShepherdPhotos<https://www.facebook.com/TonyShepherdPhotos>





[FM_logo1_small (Custom)]





___

QGIS-User mailing list

QGIS-User@lists.osgeo.org<mailto:QGIS-User@lists.osgeo.org>

List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-05 Thread Antonio Viscomi via QGIS-User
Hi Tony,
if you're using linux what you need is simply use the 'sed' command by
terminal as i.e.:

*sudo sed -i 's/NEWPATHTOSUBSTITUTE(your path or IP or domain)/OLDPATH/g'
*.qgs*

Cheers

Antonio


Il giorno ven 5 apr 2024 alle ore 09:58 Gordon Wakelin-King via QGIS-User <
qgis-user@lists.osgeo.org> ha scritto:

> There is a project packager plugin that works pretty well. It may not be
> exactly what you need but maybe the author could be approached for tips on
> the process.
>
> Get Outlook for Android <https://aka.ms/AAb9ysg>
> --
> *From:* QGIS-User  on behalf of Tony
> Shepherd (FarmMaps NZ) via QGIS-User 
> *Sent:* Friday, April 5, 2024 6:06:48 AM
> *To:* 'Jorge Gustavo Rocha' ; qgis-user@lists.osgeo.org
> 
> *Subject:* Re: [Qgis-user] Moving many project files - bulk updating
> paths to tables?
>
>
> Thanks Jorge
>
>
>
> Yes, I toyed with that, but somewhat painful with thousands to process.
>
>
>
> Has anybody scripted or coded something for this?
>
>
>
> Cheers
>
>
>
> *From:* QGIS-User  *On Behalf Of *Jorge
> Gustavo Rocha via QGIS-User
> *Sent:* Friday, April 5, 2024 7:53 AM
> *To:* qgis-user@lists.osgeo.org
> *Subject:* Re: [Qgis-user] Moving many project files - bulk updating
> paths to tables?
>
>
>
> Hi Tony,
>
> You can unzip the qgz file and change the text in the qgs files. qgs are
> text files. Afterwards, you can create the zip again with the qgz extension
> or open the qgs file directly.
>
> I hope it helps,
>
> Jorge
>
> On 04/04/24 19:28, Tony Shepherd (FarmMaps NZ) via QGIS-User wrote:
>
> Hi All
>
>
>
> I am sure I am not the first to ponder how to deal with this.  I have
> loads, thousands likely, of project files in a series of folders and
> subfolders.  I need to move those files and folders to a new location to
> enable other staff to use the project files and their associated shp files,
> geo packages, rasters etc.
>
>
>
> Essentially, I am shifting my entire collection of GIS work to a shared
> location for others to start using, so moving from a sole operator to a
> shared environment.
>
>
>
> In my old MapInfo days, I would simply do a bulk search and replace over
> the workspace files (text-based so this is easy) and change the paths that
> need changing and all would be ok.
>
>
>
> As qgz files are not easily modified through a text editor, are there any
> tools out there to enable bulk changing of file paths in those files?
>
>
>
> Any other approaches?
>
>
>
> Cheers
>
> Tony
>
>
>
>
> --
>
> *Tony Shepherd*
>
> *  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd Photos*
>
>
>
> *Phone* *–* 027 435 6193  | *Website – *shepherdphotos.co.nz
>
> *Email** – Maps* t...@farmmaps.nz  |  *Email – Photos*
> t...@shepherdphotos.co.nz
>
> *Facebook* TonyShepherdPhotos
> <https://www.facebook.com/TonyShepherdPhotos>
>
>
>
>
>
> [image: FM_logo1_small (Custom)]
>
>
>
>
>
> ___
>
> QGIS-User mailing list
>
> QGIS-User@lists.osgeo.org
>
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> ___
> QGIS-User mailing list
> QGIS-User@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-05 Thread Fernando M. Roxo da Motta via QGIS-User
On Fri, 5 Apr 2024 10:15:58 +0200, Antonio Viscomi via QGIS-User
 wrote:


> Hi Tony,
> if you're using linux what you need is simply use the 'sed' command by
> terminal as i.e.:
> 
> *sudo sed -i 's/NEWPATHTOSUBSTITUTE(your path or IP or
> domain)/OLDPATH/g' *.qgs*

  Almost, I think. 

  The syntax should be:  sed -i 's/OLDPATH/NEWAPATH/'

  As PATH usually have "/" in it, I suggest to change to:

  sed -i 's#OLDATH#NEWPATH#'

  To have to escape the slashes in the PATHs.

  Two other suggestions would be:

-  Only use sudo(8) if the superuser power is necessary, if the
   files are owned by the user do not use sudo(8).

- instead of using the "-i" parameter, that edit the files in
  place, change the command to produce another new file in the exit.
  In this way if you notice an error in the a pattern (in or out)
  it will be easier to recover.Even better, make a copy of the
  files before trying to edit them.

  Perhaps something like:

$  find . -type f -name *.qgs -exec sed 's#OLDATH#NEWPATH#' {} > {}.new \;


  HTH


> 
> Cheers
> 
> Antonio
> 
> 
> Il giorno ven 5 apr 2024 alle ore 09:58 Gordon Wakelin-King via
> QGIS-User < qgis-user@lists.osgeo.org> ha scritto:
> 
> > There is a project packager plugin that works pretty well. It may
> > not be exactly what you need but maybe the author could be
> > approached for tips on the process.
> >
> > Get Outlook for Android <https://aka.ms/AAb9ysg>
> > --
> > *From:* QGIS-User  on behalf of
> > Tony Shepherd (FarmMaps NZ) via QGIS-User
> >  *Sent:* Friday, April 5, 2024 6:06:48 AM
> > *To:* 'Jorge Gustavo Rocha' ;
> > qgis-user@lists.osgeo.org 
> > *Subject:* Re: [Qgis-user] Moving many project files - bulk updating
> > paths to tables?
> >
> >
> > Thanks Jorge
> >
> >
> >
> > Yes, I toyed with that, but somewhat painful with thousands to
> > process.
> >
> >
> >
> > Has anybody scripted or coded something for this?
> >
> >
> >
> > Cheers
> >
> >
> >
> > *From:* QGIS-User  *On Behalf Of
> > *Jorge Gustavo Rocha via QGIS-User
> > *Sent:* Friday, April 5, 2024 7:53 AM
> > *To:* qgis-user@lists.osgeo.org
> > *Subject:* Re: [Qgis-user] Moving many project files - bulk updating
> > paths to tables?
> >
> >
> >
> > Hi Tony,
> >
> > You can unzip the qgz file and change the text in the qgs files.
> > qgs are text files. Afterwards, you can create the zip again with
> > the qgz extension or open the qgs file directly.
> >
> > I hope it helps,
> >
> > Jorge
> >
> > On 04/04/24 19:28, Tony Shepherd (FarmMaps NZ) via QGIS-User wrote:
> >
> > Hi All
> >
> >
> >
> > I am sure I am not the first to ponder how to deal with this.  I
> > have loads, thousands likely, of project files in a series of
> > folders and subfolders.  I need to move those files and folders to
> > a new location to enable other staff to use the project files and
> > their associated shp files, geo packages, rasters etc.
> >
> >
> >
> > Essentially, I am shifting my entire collection of GIS work to a
> > shared location for others to start using, so moving from a sole
> > operator to a shared environment.
> >
> >
> >
> > In my old MapInfo days, I would simply do a bulk search and replace
> > over the workspace files (text-based so this is easy) and change
> > the paths that need changing and all would be ok.
> >
> >
> >
> > As qgz files are not easily modified through a text editor, are
> > there any tools out there to enable bulk changing of file paths in
> > those files?
> >
> >
> >
> > Any other approaches?
> >
> >
> >
> > Cheers
> >
> > Tony
> >
> >
> >
> >
> > --
> >
> > *Tony Shepherd*
> >
> > *  GeoSpatial Manager @ FarmMaps NZ & Photographer @ Shepherd
> > Photos*
> >
> >
> >
> > *Phone* *–* 027 435 6193  | *Website – *shepherdphotos.co.nz
> >
> > *Email** – Maps* t...@farmmaps.nz  |  *Email – Photos*
> > t...@shepherdphotos.co.nz
> >
> > *Facebook* TonyShepherdPhotos
> > <https://www.facebook.com/TonyShepherdPhotos>
> >
> >
> >
> >
> >
> > [image: FM_logo1_small (Cus

Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-05 Thread David Strip via QGIS-User


  
  
On 4/5/2024 2:15 AM, Antonio Viscomi
  via QGIS-User wrote:


  if you're using linux what you need is simply use the 'sed'
command by terminal as i.e.:
  
  
  sudo sed -i 's/NEWPATHTOSUBSTITUTE(your path or IP or
  domain)/OLDPATH/g' *.qgs


The original request noted that the files were .qgz files, not .qgs,
so you need to first unzip, the rezip the files.
And this single line solution assumes all files are in a single
directory, so you need something "find" to walk the directory
structure.
  

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-05 Thread Antonio Viscomi via QGIS-User
{
  "emoji": "👍",
  "version": 1
}___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-10 Thread Antonio Viscomi via QGIS-User
That's no matter for 'sed' command if the extension is .qgz or qgs

Saluti

Antonio


Il giorno ven 5 apr 2024 alle ore 16:00 David Strip <
qgis-u...@stripfamily.net> ha scritto:

> On 4/5/2024 2:15 AM, Antonio Viscomi via QGIS-User wrote:
>
> if you're using linux what you need is simply use the 'sed' command by
> terminal as i.e.:
>
> *sudo sed -i 's/NEWPATHTOSUBSTITUTE(your path or IP or domain)/OLDPATH/g'
> *.qgs*
>
>
> The original request noted that the files were .qgz files, not .qgs, so
> you need to first unzip, the rezip the files.
> And this single line solution assumes all files are in a single directory,
> so you need something "find" to walk the directory structure.
>
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Moving many project files - bulk updating paths to tables?

2024-04-10 Thread Fernando M. Roxo da Motta via QGIS-User
On Wed, 10 Apr 2024 17:38:58 +0200, Antonio Viscomi via QGIS-User
 wrote:


> That's no matter for 'sed' command if the extension is .qgz or qgs

  The extension itself surely not, but the contens matters.

  The '.qgs' file is a plain text XML file, that sed(1) has no problem
to work on.

  The '.qgz' file is a ZIP archive that may contain even more than a
single text file.  The '.qgs' file being one of them.   The sed(1)
command doesn't know how to deal with this kind of archive:

$ unzip -l Training_Empty.qgz
Archive:  Training_Empty.qgz
  Length  DateTimeName
-  -- -   
10858  2020-05-28 19:57   Training_Empty.qgs
0  2020-05-28 19:57   Training_Empty.qgd
- ---
10858 2 files


  HTH


> 
> Saluti
> 
> Antonio




  Roxo

-- 
 Non luctari, ludare ---+ WYSIWYG
Fernando M. Roxo da Motta   | Editor?
Except where explicitly stated I speak on my own behalf.|  VI !!
PU5RXO | PX5Q6048   | I see text,
 Quis custodiet ipsos custodes?-+ I get text!
 
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user