Skip to main content
Solved

Using FileCopy Writer to move FGDB - source folder gets left behind

  • October 17, 2016
  • 6 replies
  • 173 views

tim_wood
Contributor
Forum|alt.badge.img+8

I want to move an ESRI File Geodatabase (FGDB) from one folder to another. I have got the FileCopy Writer to move ...\\here\\data.gdb\\*.* to ..\\there\\data.gdb\\*.* but this leaves the now empty ..\\here\\data.gdb folder in the original location. I suspect this is because FGDBs are actually folders which is confusing for non-ESRI stuff (to the FileCopy Writer, it's just another folder).

I know I could probably solve this with Python, or something involving Workspace Runners and FileCopy to nul to delete the folder after moving the contents. But I wondered if anyone knows of a way of doing this within the FileCopy Writer as part of the Move operation.

Before you suggest doing ..\\here\\*.gdb, the constraint is that ..\\here\\ may contain more than one FGDB, but I only want to move one at a time. This is because I'm processing each FGDB in turn then moving it to a "processed" folder.

I've also got an idea of writing the FGDB names (the names are dynamic) to a text file then having a clean up Workspace at the end which uses this to implement the "move *.gdb" solution.

Best answer by takashi

Hi @conan_drumme, I guess the cause for your problem is that you have configured the File Copy writer to move individual FILES. Try moving the gdb FOLDER. If you set YES to the "Copy Source Folder" parameter, the writer moves the specified gdb folder and all the files belonging to the folder.

View original
Did this help you find an answer to your question?

6 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • October 18, 2016

Hi @conan_drumme, I could not reproduce your issue and managed to completely move a fgdb

by using the *.gdb path filter, but since this is not an option for you I suggest re thinking your process and possibly integrating the fgdb processing into your main workspace, so that once each fgdb is processed it is directly moved to the "processed" folder.


takashi
Influencer
  • Best Answer
  • October 18, 2016

Hi @conan_drumme, I guess the cause for your problem is that you have configured the File Copy writer to move individual FILES. Try moving the gdb FOLDER. If you set YES to the "Copy Source Folder" parameter, the writer moves the specified gdb folder and all the files belonging to the folder.


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • October 18, 2016
takashi wrote:

Hi @conan_drumme, I guess the cause for your problem is that you have configured the File Copy writer to move individual FILES. Try moving the gdb FOLDER. If you set YES to the "Copy Source Folder" parameter, the writer moves the specified gdb folder and all the files belonging to the folder.

Agree, this setting works fine for an entire folder and its files.

 

 


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • October 18, 2016
takashi wrote:

Hi @conan_drumme, I guess the cause for your problem is that you have configured the File Copy writer to move individual FILES. Try moving the gdb FOLDER. If you set YES to the "Copy Source Folder" parameter, the writer moves the specified gdb folder and all the files belonging to the folder.

Thanks. That's done it :-)

 

I was also using the path_directory_windows attribute instead of path_windows.

 

 

I noticed you have a connection directly from path_windows to file_copy_source_dataset. I was using AttributeManager to rename the field. It took me a while to figure out that I needed to connect the Reader directly to the Writer to be able to do this. All part of the learning process. Thanks for that as well as it improves performance that tiny bit!

 

 


Forum|alt.badge.img+4
  • October 18, 2016
@takashi I am trying to do something similar to Tim, where I copy out a GDB at the beginning (in order to back it up) before I proceed with some data translation.

Considering that, where in a workflow would you recommend using a filecopy writer to back up the GDB before running the translation? Is there a way to set the priority of a reader? Or do you just recommend using a python startup script?


takashi
Influencer
  • October 18, 2016
dmatranga wrote:
@takashi I am trying to do something similar to Tim, where I copy out a GDB at the beginning (in order to back it up) before I proceed with some data translation.

Considering that, where in a workflow would you recommend using a filecopy writer to back up the GDB before running the translation? Is there a way to set the priority of a reader? Or do you just recommend using a python startup script?

FME runs multiple readers in the same order that you've arranged them in the Navigator window of Workbench. Assuming that the workflow for copying consists of just a PATH reader and a File Copy writer (i.e. there is no blocking-transformer between them), I think FME runs this workflow at first if you put the PATH reader onto the top of the Navigator.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings