As a workaround I created this script, which renames the /packages/mapbox 
and /packages/turf folders to include their original '@':
https://github.com/globaldigitalheritage/arches-3d/blob/49-fix-static-paths/arches_3d/arches_3d/management/commands/azure_storage_service.py

Usage:
python manage.py azure_storage_service fix_static_paths



On Thursday, 13 September 2018 11:32:48 UTC+2, Vincent Meijer wrote:
>
> Usage:
>
>
> python manage.py azure_storage_service fix_static_paths
>
>
>
>
> On Thursday, 13 September 2018 11:32:48 UTC+2, Vincent Meijer wrote:
> I am currently setting up Arches in Azure and I encountered the following 
> problem:
>
>
> Uploaded static files where the original folder contains a special 
> character, e.g. '@Mapbox/', results in those folders being uploaded without 
> the special characters, e.g. 'Mapbox/'.
>
>
> I use this setting:
> STATICFILES_STORAGE = 'storages.backends.azure_storage.AzureStorage'
>
>
> And added this to my requirements.txt:
> django-storages[azure]==1.7.1
>
>
> I noticed that Joel steered clear of django-storages because it had nog 
> been updated at that time, but the projects seems to be alive and kicking 
> at the moment:
> https://github.com/jschneier/django-storages
>
> *Update*: django-storages-redux is now called django-storages:
> /web_root/ENV/local/lib/python2.7/site-packages/storages/__init__.py:9: 
> UserWarning: This library has been designated as the official successor 
> of django-storages and releases under that namespace. Please update your 
> requirements files to point to django-storages.
>
>
> Does anybody have experience with this?
>
> Thanks!
> Vincent
>
>
> On Thursday, 20 July 2017 09:39:11 UTC+2, Joel Aldor wrote:
>>
>> Another update: if you're using Azure storage, make sure you do this 
>> following install on your virtual environment:
>>
>> pip install azure-storage==0.20.0
>>
>>
>> On Sunday, March 19, 2017 at 3:33:16 PM UTC+8, Joel Aldor wrote:
>>>
>>> Good day,
>>>
>>> I will need to update this migration guide to add an important step. 
>>> Between steps #7 and #8, you need to install the Azure packages in order 
>>> for Arches to bind properly to your storage container.
>>>
>>> sudo pip install azure azure-storage azure-servicebus azure-mgmt 
>>> azure-servicemanagement-legacy
>>>
>>>
>>> Thanks,
>>>
>>> Joel
>>>
>>> On Tuesday, February 21, 2017 at 3:00:05 PM UTC+8, Joel Aldor wrote:
>>>>
>>>> Hi guys!
>>>>
>>>> If you plan to migrate from AWS to Microsoft Azure, I'm sharing to you 
>>>> these steps which I created on my own. I must admit the whole migration 
>>>> was 
>>>> pretty hard, since AWS doesn't allow you to export your Linux EC2 
>>>> instances 
>>>> to another cloud provider. But after weeks of trial and error, and lots of 
>>>> research, I'm finally able to migrate Arches completely. :)
>>>>
>>>> These steps will work, assuming your Arches is installed on an Ubuntu 
>>>> server running on an EC2 instance, and you're using S3 for your image and 
>>>> file storage.
>>>>
>>>> 1.) Launch an Ubuntu 14.04 LTS virtual machine on your Azure portal. 
>>>> Make sure your virtual machine has the same security group settings that 
>>>> you have on your AWS EC2 instance.
>>>>
>>>> 2.) Log in to your Ubuntu server, then change your root password 
>>>> sudo passwd root
>>>>
>>>> To allow remote login using root, you also need to edit the file 
>>>> /etc/ssh/sshd_config, and comment out the following line:
>>>> PermitRootLogin without-password 
>>>>
>>>> Just below it, add the following line:
>>>> PermitRootLogin yes 
>>>>
>>>> Save the file, then restart SSH:
>>>> service ssh restart
>>>>
>>>> *Note: Take note of your root password, because you will need it on 
>>>> step #6 as you go through the rsync shell script.*
>>>>
>>>> 3.) Create an Azure storage account, then launch an Azure storage 
>>>> container. Once you created the container, get the Azure container name 
>>>> and 
>>>> access key, which you will use on step #5.
>>>>
>>>> 4.) Get your AWS Access Key ID and Secret Access Key from your AWS 
>>>> Console's IAM, which you will use on step #5.
>>>>
>>>> 5.) Migrate your AWS S3 bucket to the new Azure storage container using 
>>>> Flexify.io. Create a free account on Flexify, then launch a migration 
>>>> task. I was able to migrate all my files totalling 6.5GB in just about 20 
>>>> minutes.
>>>>
>>>> 6.) Start the server migration process from AWS EC2 to Azure using a 
>>>> custom rsync shell script. Follow the pretty straightforward steps from 
>>>> this link here: https://cloudnull.io/2012/07/cloud-server-migration (Go 
>>>> to the section that says *Migrate using RSYNC The Easy Way *and follow 
>>>> the steps there). After the migration, the new server will automatically 
>>>> reboot itself.
>>>>
>>>> *Note: the rsync shell script uses Rackspace directory defaults, but it 
>>>> worked pretty fine on me, so just hit ENTER to continue when you're 
>>>> prompted to apply the default*
>>>>
>>>> 7.) Login to the new server, then restart Elasticsearch and Apache. By 
>>>> this point, your new server is now hosting Arches, and you can already 
>>>> open 
>>>> Arches on your browser. However it's still pointing to the old S3 bucket.
>>>>
>>>> 8.) Install the django-storages-redux by following the steps from 
>>>> here: https://github.com/schumannd/django-storages. This is a forked 
>>>> django-storages package, because the original django-storages has seen no 
>>>> commit applied since March 2014, and there were errors on the AzureStorage 
>>>> library.
>>>>
>>>> 9.) Comment out the AWS variables on settings.py and instead add these 
>>>> variables:
>>>>
>>>> DEFAULT_FILE_STORAGE = 'storages.backends.azure_storage.AzureStorage'
>>>> AZURE_ACCOUNT_NAME = '<your Azure account name>'
>>>> AZURE_ACCOUNT_KEY = '<your Azure access key>'
>>>> AZURE_CONTAINER = '<your container name>'
>>>> MEDIA_URL = '<the URL of your Azure container, which is normally 
>>>> https://your_azure_account_name.blob.core.windows.net/your_azure_container
>>>> >'
>>>>
>>>> 10.) Save your settings.py file, then restart your Apache server. 
>>>>
>>>> *And you're done! *You can now point your domain to the new Azure 
>>>> virtual machine and start decommissioning your AWS resources.
>>>>
>>>> If there's any problem you're encountering, please let me know here and 
>>>> I'd be happy to help!
>>>>
>>>> Special thanks to Adam Cox for helping me out on some parts of this 
>>>> migration process!
>>>>
>>>> Regards, 
>>>>
>>>> Joel
>>>>
>>>

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to