Jump to content
David Jondreau

Two SC servers, one database

Recommended Posts

I've got a couple SC licenses running on different servers. I've got one database and I want to store files on both servers. (why? well, I'm migrating from one server to another, but it's go to be done over a couple months due to bandwidth limitations).

I'm storing each image's filepath as a record in a standalone table. That full filepath will be different depending on the host for that file. When calling any of the plugin functions by script, I believe got to also call SCSetBaseURL, right? That base host is either taken from the record (if downloading) or given based on business logic (if uploading).
I want a calculated FM Container field using SCGetContainer(). I think I have to call SCSetBaseURL() in the calculation field as well. I've never used SCSetBaseURL() in a field definition, so I'm a little wary. I've tested it and it works. There's a slight performance hit.

Is calling SCSetBaseURL() every time I call a SC plugin the best way to do what I'm trying to do? Is there a way to use a full filepath to SC rather than a local filepath for these plugin functions?

Thanks and I love the product!

Share this post


Link to post
Share on other sites

David,

You only need to call SCSetBaseURL when you want to change which SuperContainer you want to download/upload to. So if you call SCSetBaseURL("http://MySCServer.com/SuperContainer/Files") all subsequent calls to the companion plugin will be in reference to that base URL. You will not need to call SCSetBaseURL again unless you want to upload/download to a different instance of SuperContainer.

Hope that helps!

 

Share this post


Link to post
Share on other sites

Thanks for the reply.

What is the downside to calling SCSetBaseURL()? Is there any way to determine what the current base URL is? (I'm aware I could capture it in a $$var, sure.) And would that method have fewer downsides that just calling SCSet?

Is there a way to use a fully path, rather than calling SCSet?

I am referencing files using as records in a table. Each record may have a different host. Therefore, when I want to reference a file, I have to know the existing base path to compare. Or just change it on the fly.

 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.